From b5f964d85b4271a40cea470c4344bc5ef912d79b Mon Sep 17 00:00:00 2001 From: twanvl Date: Sun, 6 May 2007 01:10:58 +0000 Subject: [PATCH] fixed bug in parser for if statement without else git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@322 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/script/parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/script/parser.cpp b/src/script/parser.cpp index 0d463150..c8c8410d 100644 --- a/src/script/parser.cpp +++ b/src/script/parser.cpp @@ -405,7 +405,8 @@ void parseExpr(TokenIterator& input, Script& script, Precedence minPrec) { jmpEnd = script.getLabel(); // jmp_end: script.addInstruction(I_JUMP, 0xFFFF); // jump lbl_end script.comeFrom(jmpElse); // lbl_else: - if (input.read() == _("else")) { // else + if (input.peek() == _("else")) { // else + input.read(); parseOper(input, script, PREC_SET); // CCC } else { script.addInstruction(I_PUSH_CONST, script_nil);