testing evaluate/isConditional

This commit is contained in:
Daniel Marjamäki 2021-05-13 08:56:33 +02:00
parent 37d373999f
commit 91c7e26720
1 changed files with 3 additions and 1 deletions

View File

@ -652,7 +652,9 @@ struct ForwardTraversal {
} else if (Token::simpleMatch(tok, "switch (")) {
if (updateRecursive(tok->next()->astOperand2()) == Progress::Break)
return Break();
if (!analyzer->isKnown())
std::vector<int> result = analyzer->evaluate(tok->next()->astOperand2());
if (!result.empty() || analyzer->isConditional())
// TODO if result is not empty then execute the corresponding case
return Break();
Token *bodyStart = tok->linkAt(1)->next();
const Token *bodyEnd = bodyStart->link();