SynEdit: Pas-HL, test for ^ in PMyByte = type ^Byte;

git-svn-id: trunk@55376 -
This commit is contained in:
martin 2017-06-17 14:38:06 +00:00
parent 15cc958b7e
commit 698d8d24af
2 changed files with 23 additions and 19 deletions

View File

@ -917,6 +917,7 @@ end;
function TSynPasSyn.Func15: TtkTokenKind;
begin
if KeyComp('If') then begin
//TODO: case a of 1: while x do if e then ...
StartPascalCodeFoldBlock(cfbtIfThen, TopPascalCodeFoldBlockType in [cfbtCase, cfbtIfThen]);
Result := tkKey
end

View File

@ -1125,11 +1125,12 @@ begin
'b:^char=nil;',
'type',
'c=^char;', // 5
'c=type ^char;', // 6
'implementation',
'function x(f:^char=^k):^v;', // actually the compiler does not allow ^ as pointer for result
'var',
'a:char=^o;',
'b:^char=nil;', // 10
'a:char=^o;', // 10
'b:^char=nil;', // 11
'type',
'c=^char;',
'begin',
@ -1138,8 +1139,8 @@ begin
'c:=p^;',
'c:=p ^;',
'c:=p(**)^;',
'c:=p{} ^;',
'i:=f(1)^;', // 20
'c:=p{} ^;', // 20
'i:=f(1)^;', // 21
'i:=f[1]^;',
'i:=f^^;',
'c:=p^+^i''e''^a#13^x;',
@ -1154,46 +1155,48 @@ begin
[tkIdentifier, tkSymbol, tkSymbol, tkIdentifier, tkSymbol, tkKey, tkSymbol]);
CheckTokensForLine('c=^char;', 5,
[tkIdentifier, tkSymbol, tkSymbol, tkIdentifier, tkSymbol]);
CheckTokensForLine('c=type ^char;', 6,
[tkIdentifier, tkSymbol, tkKey, tkSpace, tkSymbol, tkIdentifier, tkSymbol]);
CheckTokensForLine('function x(f:^char=^k):^v;', 7,
CheckTokensForLine('function x(f:^char=^k):^v;', 8,
[tkKey, tkSpace, tkIdentifier, tkSymbol, tkIdentifier, // function x(f
tkSymbol, tkSymbol, tkIdentifier, tkSymbol, tkString, // :^char=^k
tkSymbol, tkSymbol, tkSymbol, tkIdentifier, tkSymbol]); // ):^v;
CheckTokensForLine('LOCAL a:char=^o;', 9,
CheckTokensForLine('LOCAL a:char=^o;', 10,
[tkIdentifier, tkSymbol, tkIdentifier, tkSymbol, tkString, tkSymbol]);
CheckTokensForLine('LOCAL b:^char=nil;', 10,
CheckTokensForLine('LOCAL b:^char=nil;', 11,
[tkIdentifier, tkSymbol, tkSymbol, tkIdentifier, tkSymbol, tkKey, tkSymbol]);
CheckTokensForLine('LOCAL c=^char;', 12,
CheckTokensForLine('LOCAL c=^char;', 13,
[tkIdentifier, tkSymbol, tkSymbol, tkIdentifier, tkSymbol]);
CheckTokensForLine('i:=^f', 14,
CheckTokensForLine('i:=^f', 15,
[tkIdentifier, tkSymbol, tkString, tkSymbol]);
CheckTokensForLine('x:=GetTypeData(PropInfo^.PropType{$IFNDEF FPC}^{$ENDIF});', 15,
CheckTokensForLine('x:=GetTypeData(PropInfo^.PropType{$IFNDEF FPC}^{$ENDIF});', 16,
[tkIdentifier, tkSymbol, tkIdentifier, tkSymbol, // x:=GetTypeData(
tkIdentifier, tkSymbol, tkSymbol, tkIdentifier, // PropInfo^.PropType
tkDirective, tkSymbol, tkDirective, tkSymbol, tkSymbol]); // {$IFNDEF FPC}^{$ENDIF});
CheckTokensForLine('c:=p^;', 16,
CheckTokensForLine('c:=p^;', 17,
[tkIdentifier, tkSymbol, tkIdentifier, tkSymbol, tkSymbol]);
CheckTokensForLine('c:=p ^;', 17,
CheckTokensForLine('c:=p ^;', 18,
[tkIdentifier, tkSymbol, tkIdentifier, tkSpace, tkSymbol, tkSymbol]);
CheckTokensForLine('c:=p(**)^;', 18,
CheckTokensForLine('c:=p(**)^;', 19,
[tkIdentifier, tkSymbol, tkIdentifier, tkComment, tkSymbol, tkSymbol]);
CheckTokensForLine('c:=p{} ^;', 19,
CheckTokensForLine('c:=p{} ^;', 20,
[tkIdentifier, tkSymbol, tkIdentifier, tkComment, tkSpace, tkSymbol, tkSymbol]);
CheckTokensForLine('c:=p(1)^;', 20,
CheckTokensForLine('c:=p(1)^;', 21,
[tkIdentifier, tkSymbol, tkIdentifier, tkSymbol, tkNumber, tkSymbol, tkSymbol]);
CheckTokensForLine('c:=p[1]^;', 21,
CheckTokensForLine('c:=p[1]^;', 22,
[tkIdentifier, tkSymbol, tkIdentifier, tkSymbol, tkNumber, tkSymbol, tkSymbol]);
CheckTokensForLine('c:=p^^;', 22,
CheckTokensForLine('c:=p^^;', 23,
[tkIdentifier, tkSymbol, tkIdentifier, tkSymbol, tkSymbol, tkSymbol]);
CheckTokensForLine('c:=p^+^i''e''^a#13^x;', 23,
CheckTokensForLine('c:=p^+^i''e''^a#13^x;', 24,
[tkIdentifier, tkSymbol, tkIdentifier, tkSymbol, tkSymbol, // c:=p^+
tkString, tkString, tkString, tkString, tkString, tkSymbol // ^i'e'^a#13^x;
]);
CheckTokensForLine('c:=x=^a and ^a=k and(^a^a=z);', 24,
CheckTokensForLine('c:=x=^a and ^a=k and(^a^a=z);', 25,
[tkIdentifier, tkSymbol, tkIdentifier, tkSymbol, tkString, tkSpace, // c:=x=^a
tkKey, tkSpace, tkString, tkSymbol, tkIdentifier, tkSpace, // and ^a=k
tkKey, tkSymbol, tkString, tkString, tkSymbol, tkIdentifier, // and(^a^a=z