codetools: fixed skipping else

git-svn-id: trunk@27515 -
This commit is contained in:
mattias 2010-09-28 19:17:03 +00:00
parent b839e824d2
commit ca800a022a
2 changed files with 3 additions and 2 deletions

View File

@ -1416,11 +1416,11 @@ begin
AddError('then expected, but '+GetAtomOrNothing+' found'); AddError('then expected, but '+GetAtomOrNothing+' found');
// then statement // then statement
ReadRawNextPascalAtom(Src,AtomStart); ReadRawNextPascalAtom(Src,AtomStart);
RunStatement(not ExprIsTrue); RunStatement(Skip or not ExprIsTrue);
if CompareIdentifiers(AtomStart,'else')=0 then begin if CompareIdentifiers(AtomStart,'else')=0 then begin
// else statement // else statement
ReadRawNextPascalAtom(Src,AtomStart); ReadRawNextPascalAtom(Src,AtomStart);
RunStatement(ExprIsTrue); RunStatement(Skip or ExprIsTrue);
end; end;
// clean up stack // clean up stack
while FStack.Top>StartTop do FStack.Pop; while FStack.Top>StartTop do FStack.Pop;

View File

@ -68,6 +68,7 @@ begin
end else begin end else begin
writeln('Result="',Engine.Variables['Result'],'"'); writeln('Result="',Engine.Variables['Result'],'"');
end; end;
Engine.Variables.WriteDebugReport('Variables');
except except
on E: Exception do begin on E: Exception do begin
writeln(E.Message); writeln(E.Message);