fixed problem with parsing optional string arguments

actorid
Marc Zinnschlag 13 years ago
parent 100c6a42a5
commit d9677cb33e

@ -650,7 +650,7 @@ namespace MWDialogue
locals = mEnvironment.mScriptManager->getLocals (actorScript);
}
Compiler::ScriptParser parser(mErrorHandler,mCompilerContext, locals);
Compiler::ScriptParser parser(mErrorHandler,mCompilerContext, locals, false);
scanner.scan (parser);
if(mErrorHandler.isGood())
@ -712,7 +712,7 @@ namespace MWDialogue
win->addText(it->response);
executeScript(script);
mLastTopic = keyword;
mLastDialogue = dial;
break;
@ -756,7 +756,7 @@ namespace MWDialogue
mLastDialogue = *it;
break;
}
}
}
}
}

@ -24,7 +24,7 @@ namespace Compiler
mLineParser.reset();
if (mLineParser.parseName (name, loc, scanner))
scanner.scan (mLineParser);
return true;
}
@ -34,22 +34,22 @@ namespace Compiler
{
mControlParser.reset();
if (mControlParser.parseKeyword (keyword, loc, scanner))
scanner.scan (mControlParser);
scanner.scan (mControlParser);
mControlParser.appendCode (mOutput.getCode());
return true;
}
if (keyword==Scanner::K_end && mEnd)
{
return false;
}
mLineParser.reset();
if (mLineParser.parseKeyword (keyword, loc, scanner))
scanner.scan (mLineParser);
return true;
}
@ -57,11 +57,11 @@ namespace Compiler
{
if (code==Scanner::S_newline) // empty line
return true;
mLineParser.reset();
if (mLineParser.parseSpecial (code, loc, scanner))
scanner.scan (mLineParser);
return true;
}
@ -77,4 +77,3 @@ namespace Compiler
mOutput.clear();
}
}

@ -39,6 +39,11 @@ namespace Compiler
mState = CommaState;
return true;
}
else if (code==Scanner::S_newline && mState==StartState)
{
scanner.putbackSpecial (code, loc);
return false;
}
return Parser::parseSpecial (code, loc, scanner);
}

Loading…
Cancel
Save