Skip to content

Commit

Permalink
Fix RomanYankovsky#134: Fails to parse code with ^\
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanYankovsky committed Oct 10, 2015
1 parent 2a4ce1f commit 25519b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/SimpleParser/SimpleParser.Lexer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,7 @@ procedure TmwBasePasLex.PointerSymbolProc;
const
PointerChars = ['a'..'z', 'A'..'Z', '\', '!', '"', '#', '$', '%', '&', '''', '(', ')',
'*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[',
']', '^', '_', '`', '{', '|', '}', '~'];
'^', '_', '`', '{', '|', '}', '~']; // TODO: support ']'
begin
Inc(Run);
FTokenID := ptPointerSymbol;
Expand Down
12 changes: 10 additions & 2 deletions Test/Snippets/pointerchars.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ interface
implementation

procedure FormKeyPress(Sender: TObject; var Key: Char);
var
P: PInteger;
Arr: array of Integer;
begin
if Arr[P^] > 0 then
begin
// some code
end;

if Key = ^\ then
begin
//some code
Expand All @@ -16,10 +24,10 @@ procedure FormKeyPress(Sender: TObject; var Key: Char);
//some code
end;

if Key = ^] then
if Key = ^[ then
begin
//some code
end;
end;

end.
end.

0 comments on commit 25519b3

Please sign in to comment.