Add non static evaluation for simple expressions

This commit is contained in:
Jan
2022-08-13 14:13:11 +02:00
parent 403d7f2c44
commit 886bcfeaf8
21 changed files with 161 additions and 59 deletions

View File

@ -327,7 +327,7 @@ bool DefinesStreamProxy::MatchIfDirective(const ParserLine& line, const unsigned
if (!expression)
throw ParsingException(CreatePos(line, currentPos), "Failed to parse if expression");
m_modes.push(expression->Evaluate().IsTruthy() ? BlockMode::IN_BLOCK : BlockMode::NOT_IN_BLOCK);
m_modes.push(expression->EvaluateStatic().IsTruthy() ? BlockMode::IN_BLOCK : BlockMode::NOT_IN_BLOCK);
return true;
}
@ -369,7 +369,7 @@ bool DefinesStreamProxy::MatchElIfDirective(const ParserLine& line, const unsign
if (!expression)
throw ParsingException(CreatePos(line, currentPos), "Failed to parse elif expression");
m_modes.top() = expression->Evaluate().IsTruthy() ? BlockMode::IN_BLOCK : BlockMode::NOT_IN_BLOCK;
m_modes.top() = expression->EvaluateStatic().IsTruthy() ? BlockMode::IN_BLOCK : BlockMode::NOT_IN_BLOCK;
return true;
}