Fixed a bug in do..while - now works

git-svn-id: http://picoc.googlecode.com/svn/trunk@89 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2009-02-19 11:01:14 +00:00
parent 65db9a490a
commit 2ba0598f1c

View file

@ -677,6 +677,9 @@ int ParseStatement(struct ParseState *Parser)
if (Parser->Mode == RunModeContinue) if (Parser->Mode == RunModeContinue)
Parser->Mode = RunModeRun; Parser->Mode = RunModeRun;
if (LexGetToken(Parser, NULL, TRUE) != TokenWhile)
ProgramFail(Parser, "'while' expected");
Condition = ParseIntExpression(Parser); Condition = ParseIntExpression(Parser);
} while (Condition && Parser->Mode == RunModeRun); } while (Condition && Parser->Mode == RunModeRun);