codetools: fixed parsing on e:exception do ;, bug #23549

git-svn-id: trunk@39681 -
This commit is contained in:
mattias 2012-12-29 12:08:34 +00:00
parent af39ff4c28
commit 33e29aca8a

View File

@ -3142,6 +3142,8 @@ function TPascalParserTool.ReadOnStatement(ExceptionOnError,
// on Unit.Exception do ;
// on Unit.Exception do else ;
// on Unit.Exception do ; else ;
var
NeedUndo: Boolean;
begin
if CreateNodes then begin
CreateChildNode;
@ -3205,15 +3207,20 @@ begin
CurNode.EndPos:=CurPos.EndPos;
EndChildNode; // ctnOnVariable
end;
NeedUndo:=false;
if CurPos.Flag=cafSemicolon then begin
// for example: on E: Exception do ; else ;
ReadNextAtom;
NeedUndo:=true;
end;
if UpAtomIs('ELSE') then begin
// for example: on E: Exception do else ;
ReadNextAtom;
ReadTilStatementEnd(true,CreateNodes);
NeedUndo:=false;
end;
if NeedUndo then
UndoReadNextAtom;
Result:=true;
end;