mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 15:40:41 +02:00
SynEdit: highlight class "helper". Fix wrong highlight of "sealed" Issue #0021812 Tests
git-svn-id: trunk@37113 -
This commit is contained in:
parent
a8c17c1034
commit
b4d22ba095
@ -45,6 +45,7 @@ type
|
||||
procedure TestContextForProcedure;
|
||||
procedure TestContextForDeprecated;
|
||||
procedure TestContextForClassModifier; // Sealed abstract
|
||||
procedure TestContextForClassHelper;
|
||||
procedure TestContextForStatic;
|
||||
procedure TestFoldNodeInfo;
|
||||
end;
|
||||
@ -741,6 +742,85 @@ begin
|
||||
CheckTokensForLine('class declaration"', 2,
|
||||
[ tkIdentifier, tkSpace, tkSymbol, tkSpace,
|
||||
tkKey {class}, tkSpace,
|
||||
tkKey {sealed}, tkSpace, tkKey {abstract}
|
||||
]);
|
||||
CheckTokensForLine('var in class "', 3,
|
||||
[ tkIdentifier, tkSymbol, tkSpace, tkIdentifier, tkSymbol, tkSpace, tkIdentifier, tkSymbol,
|
||||
tkSpace, tkIdentifier, tkSymbol
|
||||
]);
|
||||
CheckTokensForLine('procedure in class "', 4,
|
||||
[ tkKey, tkSpace, tkIdentifier, tkSymbol, tkSpace, tkKey, tkSymbol ]);
|
||||
|
||||
|
||||
|
||||
ReCreateEdit;
|
||||
SetLines
|
||||
([ 'Unit A; interface',
|
||||
'type',
|
||||
'TFoo = class {} sealed abstract',
|
||||
'a, sealed, abstract: Integer;',
|
||||
'procedure Foo; abstract;',
|
||||
'end;',
|
||||
''
|
||||
]);
|
||||
|
||||
CheckTokensForLine('class declaration"', 2,
|
||||
[ tkIdentifier, tkSpace, tkSymbol, tkSpace,
|
||||
tkKey {class}, tkSpace, tkComment, tkSpace,
|
||||
tkKey {sealed}, tkSpace, tkKey {abstract}
|
||||
]);
|
||||
CheckTokensForLine('var in class "', 3,
|
||||
[ tkIdentifier, tkSymbol, tkSpace, tkIdentifier, tkSymbol, tkSpace, tkIdentifier, tkSymbol,
|
||||
tkSpace, tkIdentifier, tkSymbol
|
||||
]);
|
||||
CheckTokensForLine('procedure in class "', 4,
|
||||
[ tkKey, tkSpace, tkIdentifier, tkSymbol, tkSpace, tkKey, tkSymbol ]);
|
||||
|
||||
|
||||
|
||||
ReCreateEdit;
|
||||
SetLines
|
||||
([ 'Unit A; interface',
|
||||
'type',
|
||||
'TFoo = class {}',
|
||||
' sealed abstract',
|
||||
'a, sealed, abstract: Integer;',
|
||||
'procedure Foo; abstract;',
|
||||
'end;',
|
||||
''
|
||||
]);
|
||||
|
||||
CheckTokensForLine('class declaration"', 2,
|
||||
[ tkIdentifier, tkSpace, tkSymbol, tkSpace,
|
||||
tkKey {class}, tkSpace, tkComment
|
||||
]);
|
||||
CheckTokensForLine('class declaration"', 3,
|
||||
[ tkSpace, tkKey {sealed}, tkSpace, tkKey {abstract}
|
||||
]);
|
||||
CheckTokensForLine('var in class "', 4,
|
||||
[ tkIdentifier, tkSymbol, tkSpace, tkIdentifier, tkSymbol, tkSpace, tkIdentifier, tkSymbol,
|
||||
tkSpace, tkIdentifier, tkSymbol
|
||||
]);
|
||||
CheckTokensForLine('procedure in class "', 5,
|
||||
[ tkKey, tkSpace, tkIdentifier, tkSymbol, tkSpace, tkKey, tkSymbol ]);
|
||||
|
||||
|
||||
|
||||
|
||||
ReCreateEdit;
|
||||
SetLines
|
||||
([ 'Unit A; interface',
|
||||
'type',
|
||||
'TFoo = class(sealed) sealed abstract',
|
||||
'helper, sealed, abstract: Integer;',
|
||||
'procedure Foo; abstract;',
|
||||
'end;',
|
||||
''
|
||||
]);
|
||||
|
||||
CheckTokensForLine('class declaration"', 2,
|
||||
[ tkIdentifier, tkSpace, tkSymbol, tkSpace,
|
||||
tkKey {class}, tkSymbol, tkIdentifier, tkSymbol, tkSpace,
|
||||
tkKey {sealed}, tkSpace,
|
||||
tkKey {abstract}
|
||||
]);
|
||||
@ -751,6 +831,34 @@ begin
|
||||
CheckTokensForLine('procedure in class "', 4,
|
||||
[ tkKey, tkSpace, tkIdentifier, tkSymbol, tkSpace, tkKey, tkSymbol ]);
|
||||
|
||||
|
||||
end;
|
||||
|
||||
procedure TTestHighlighterPas.TestContextForClassHelper;
|
||||
begin
|
||||
ReCreateEdit;
|
||||
SetLines
|
||||
([ 'Unit A; interface',
|
||||
'type',
|
||||
'TFoo = class helper for TBar',
|
||||
'helper, sealed, abstract: Integer;',
|
||||
'procedure Foo; abstract;',
|
||||
'end;',
|
||||
''
|
||||
]);
|
||||
|
||||
CheckTokensForLine('class declaration"', 2,
|
||||
[ tkIdentifier, tkSpace, tkSymbol, tkSpace,
|
||||
tkKey {class}, tkSpace, tkKey {helper}, tkSpace, tkKey {for},
|
||||
tkSpace, tkIdentifier
|
||||
]);
|
||||
CheckTokensForLine('var in class "', 3,
|
||||
[ tkIdentifier, tkSymbol, tkSpace, tkIdentifier, tkSymbol, tkSpace, tkIdentifier, tkSymbol,
|
||||
tkSpace, tkIdentifier, tkSymbol
|
||||
]);
|
||||
CheckTokensForLine('procedure in class "', 4,
|
||||
[ tkKey, tkSpace, tkIdentifier, tkSymbol, tkSpace, tkKey, tkSymbol ]);
|
||||
|
||||
end;
|
||||
|
||||
procedure TTestHighlighterPas.TestContextForStatic;
|
||||
|
Loading…
Reference in New Issue
Block a user