mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-01 04:49:26 +02:00
codetools: fixed parsing on e:exception do ; else, bug #23549
git-svn-id: trunk@39680 -
This commit is contained in:
parent
afe0a4ea69
commit
af39ff4c28
@ -2831,7 +2831,7 @@ begin
|
||||
RaiseStrExpectedWithBlockStartHint('"if"');
|
||||
end else if CreateNodes and UpAtomIs('WITH') then begin
|
||||
ReadWithStatement(true,CreateNodes);
|
||||
end else if CreateNodes and UpAtomIs('ON') and (BlockType=ebtTry)
|
||||
end else if UpAtomIs('ON') and (BlockType=ebtTry)
|
||||
and (TryType=ttExcept) then begin
|
||||
ReadOnStatement(true,CreateNodes);
|
||||
end else begin
|
||||
@ -2849,6 +2849,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
until false;
|
||||
//debugln(['TPascalParserTool.ReadTilBlockEnd end=',GetAtom]);
|
||||
end;
|
||||
|
||||
function TPascalParserTool.ReadTilBlockStatementEnd(
|
||||
@ -3139,6 +3140,8 @@ function TPascalParserTool.ReadOnStatement(ExceptionOnError,
|
||||
// on E: Exception do ;
|
||||
// on Exception do ;
|
||||
// on Unit.Exception do ;
|
||||
// on Unit.Exception do else ;
|
||||
// on Unit.Exception do ; else ;
|
||||
begin
|
||||
if CreateNodes then begin
|
||||
CreateChildNode;
|
||||
@ -3202,6 +3205,15 @@ begin
|
||||
CurNode.EndPos:=CurPos.EndPos;
|
||||
EndChildNode; // ctnOnVariable
|
||||
end;
|
||||
if CurPos.Flag=cafSemicolon then begin
|
||||
// for example: on E: Exception do ; else ;
|
||||
ReadNextAtom;
|
||||
end;
|
||||
if UpAtomIs('ELSE') then begin
|
||||
// for example: on E: Exception do else ;
|
||||
ReadNextAtom;
|
||||
ReadTilStatementEnd(true,CreateNodes);
|
||||
end;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user