AST: fixed hang for ',&x..'
This commit is contained in:
parent
8910bae801
commit
9959c2866c
|
@ -392,7 +392,11 @@ void TokenList::createAst() const
|
|||
while (tok->next())
|
||||
tok = tok->next();
|
||||
for (; tok; tok = tok->previous()) {
|
||||
if (tok->isOp() && (!tok->previous() || tok->previous()->isOp() || tok->previous()->type() == Token::eOther) &&
|
||||
if (tok->isOp() &&
|
||||
(!tok->previous() ||
|
||||
tok->previous()->isOp() ||
|
||||
tok->previous()->str() == "," ||
|
||||
tok->previous()->type() == Token::eOther) &&
|
||||
op.find(" "+tok->str()+" ")!=std::string::npos) {
|
||||
tok->astOperand1(tok->next());
|
||||
}
|
||||
|
|
|
@ -9985,6 +9985,7 @@ private:
|
|||
ASSERT_EQUALS("1(f+2+", testAst("1+f()+2"));
|
||||
ASSERT_EQUALS("12f+3+", testAst("1+f(2)+3"));
|
||||
ASSERT_EQUALS("123,f+4+", testAst("1+f(2,3)+4"));
|
||||
ASSERT_EQUALS("12a&,f+", testAst("1+f(2,&a)"));
|
||||
}
|
||||
|
||||
void asttemplate() const { // uninstantiated templates will have <,>,etc.. how do we handle them?
|
||||
|
|
Loading…
Reference in New Issue