don't ignore parsing errors in eval() and on the command line

to optimally support cumulative mode, the parser will happily return a
bytecode object even when parsing failed, so errors must be treated
later.

Change-Id: I1a5c0ca9bf46a93d7359f590f0dd0ddc96baba0a
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Oswald Buddenhagen
2012-07-27 19:56:28 +02:00
parent 160e608f5a
commit bb063b35f4
2 changed files with 16 additions and 10 deletions

View File

@@ -1012,15 +1012,19 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction(
case T_REQUIRES:
#endif
case T_EVAL: {
VisitReturn ret = ReturnFalse;
ProFile *pro = m_parser->parsedProBlock(fL1S("(eval)"),
args.join(statics.field_sep));
if (!pro)
return ReturnFalse;
m_locationStack.push(m_current);
visitProBlock(pro, pro->tokPtr());
m_current = m_locationStack.pop();
pro->deref();
return ReturnTrue; // This return value is not too useful, but that's qmake
if (pro) {
if (m_cumulative || pro->isOk()) {
m_locationStack.push(m_current);
visitProBlock(pro, pro->tokPtr());
ret = ReturnTrue; // This return value is not too useful, but that's qmake
m_current = m_locationStack.pop();
}
pro->deref();
}
return ret;
}
case T_BREAK:
if (m_skipLevel)