* Fix bug ID #31524

git-svn-id: trunk@35593 -
This commit is contained in:
michael 2017-03-15 15:01:45 +00:00
parent ca9e2f5e5d
commit 0a9031c76f
2 changed files with 18 additions and 2 deletions

View File

@ -4170,7 +4170,7 @@ begin
begin begin
NextToken; NextToken;
curblock.AddCommand('goto '+curtokenstring); curblock.AddCommand('goto '+curtokenstring);
expecttoken(tkSemiColon); // expecttoken(tkSemiColon);
end; end;
tkfor: tkfor:
begin begin

View File

@ -112,6 +112,7 @@ Type
Procedure TestTryExceptOnIfElse; Procedure TestTryExceptOnIfElse;
procedure TestTryExceptRaise; procedure TestTryExceptRaise;
Procedure TestAsm; Procedure TestAsm;
Procedure TestGotoInIfThen;
end; end;
implementation implementation
@ -1646,6 +1647,21 @@ begin
AssertEquals('token 4 ','1',T.Tokens[3]); AssertEquals('token 4 ','1',T.Tokens[3]);
end; end;
Procedure TTestStatementParser.TestGotoInIfThen;
begin
AddStatements(['if expr then',
' dosomething',
' else if expr2 then',
' goto try_qword',
' else',
' dosomething;',
' try_qword:',
' dosomething;',
'end.']);
ParseModule;
end;
initialization initialization
RegisterTests([TTestStatementParser]); RegisterTests([TTestStatementParser]);