mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-02 13:19:49 +01:00
codetools: fixed parsing on e:exception do ;, bug #23549
git-svn-id: trunk@39681 -
This commit is contained in:
parent
af39ff4c28
commit
33e29aca8a
@ -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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user