mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 00:29:33 +02:00
parent
4a6358bfc1
commit
abe463d576
@ -5986,7 +5986,20 @@ begin
|
||||
El:=nil;
|
||||
end;
|
||||
if (CurToken=tkelse) and (TPasImplIfElse(CurBlock).ElseBranch=nil) then
|
||||
break; // add next statement as ElseBranch
|
||||
begin
|
||||
// Check if next token is an else too
|
||||
NextToken;
|
||||
if CurToken = tkElse then
|
||||
begin
|
||||
// empty ELSE statement without semicolon e.g. if condition then [...] else else
|
||||
El:=TPasImplCommand(CreateElement(TPasImplCommand,'', CurBlock,CurTokenPos));
|
||||
CurBlock.AddElement(El); // this sets TPasImplIfElse(CurBlock).IfBranch:=El
|
||||
El:=nil;
|
||||
CloseBlock;
|
||||
end;
|
||||
UngetToken;
|
||||
break; // add next statement as ElseBranch
|
||||
end;
|
||||
end
|
||||
else if (CurBlock is TPasImplTryExcept) and (CurToken=tkelse) then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user