SynEdit: PascalHighlighter, implement new highlights for declaration sections and proc-headers: param, type, value. / fix missing ranges in scan

This commit is contained in:
Martin 2025-03-12 00:23:47 +01:00
parent 83509a5b76
commit 9cadb97d54
2 changed files with 11 additions and 2 deletions

View File

@ -5103,7 +5103,7 @@ begin
FTokenHashKey := 0;
fProcTable[fLine[Run]];
if not (FIsInNextToEOL or IsScanning) then begin
//if not (FIsInNextToEOL or IsScanning) then begin
CheckForAdditionalAttributes;
if FTokenTypeDeclExtraAttrib <> FLastTokenTypeDeclExtraAttrib then begin
FLastTokenTypeDeclExtraAttrib := FTokenTypeDeclExtraAttrib;
@ -5112,7 +5112,7 @@ begin
end
else
FLastTokenTypeDeclExtraAttrib := FTokenTypeDeclExtraAttrib;
end;
//end;
if not (FTokenID in [tkSpace, tkComment, tkIDEDirective, tkDirective, tkNull]) then
FTokenState := FNextTokenState;

View File

@ -3349,6 +3349,8 @@ begin
'function Foo: string;',
'function Foo(var a:byte;b, b2:string;c:array of boolean): integer;',
'function Foo(d:word=2-x;e:boolean=(1=y*2);f:qword=default(qword); g:MySet=[a1..a2]): integer;',
'procedure Foo(a:byte;', //5
'b, b2:word);',
''
]);
@ -3392,6 +3394,13 @@ begin
TK_Bracket, TK_Colon, tkSpace,
tkIdentifier+ProcRes, TK_Semi]);
CheckTokensForLine('6: procedure Foo(a:byte;', 5,
[tkKey, tkSpace, tkIdentifier+ProcName, TK_Bracket,
tkIdentifier+ProcParam, TK_Semi]);
CheckTokensForLine('7: b, b2:word);', 6,
[tkIdentifier+ProcParam, TK_Comma, tkSpace, tkIdentifier+ProcParam, TK_Colon,
tkIdentifier+ProcType, TK_Bracket, TK_Semi]);
//PropName.Clear;
//PasHighLighter.DeclaredTypeAttributeMode := tamIdentifierOnly;