* Fix for bug #37760

git-svn-id: trunk@47019 -
This commit is contained in:
michael 2020-09-30 14:01:00 +00:00
parent 4a6358bfc1
commit abe463d576

View File

@ -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