* patch for ^\ by Dmitry, bug #16341

git-svn-id: trunk@15727 -
This commit is contained in:
marco 2010-08-06 14:09:53 +00:00
parent a39525f341
commit a78a3f1171
2 changed files with 16 additions and 0 deletions

View File

@ -756,6 +756,15 @@ begin
tkfalse, tktrue: x:=TBoolConstExpr.Create(pekBoolConst, CurToken=tktrue);
tknil: x:=TNilExpr.Create;
tkSquaredBraceOpen: x:=ParseParams(pekSet);
tkCaret: begin
// ^A..^_ characters. See #16341
NextToken;
if not (length(CurTokenText)=1) or not (CurTokenText[1] in ['A'..'_']) then begin
UngetToken;
ParseExc(SParserExpectedIdentifier);
end;
x:=TPrimitiveExpr.Create(pekString, '^'+CurTokenText);
end;
else
ParseExc(SParserExpectedIdentifier);
end;

View File

@ -59,6 +59,7 @@ type
tkSquaredBraceOpen, // '['
tkSquaredBraceClose, // ']'
tkCaret, // '^'
tkBackslash, // '\'
// Two-character tokens
tkDotDot, // '..'
tkAssign, // ':='
@ -260,6 +261,7 @@ const
'[',
']',
'^',
'\',
'..',
':=',
'<>',
@ -916,6 +918,11 @@ begin
Inc(TokenStr);
Result := tkCaret;
end;
'\':
begin
Inc(TokenStr);
Result := tkBackslash;
end;
'{': // Multi-line comment
begin
Inc(TokenStr);