AST: Handle ({..})

This commit is contained in:
Daniel Marjamäki 2013-11-25 04:07:44 +01:00
parent 43f00942dd
commit 94e2bf7a11
2 changed files with 7 additions and 0 deletions

View File

@ -478,6 +478,9 @@ static void compileTerm(Token *& tok, std::stack<Token*> &op)
op.pop();
}
op.push(unaryop);
} else if (Token::Match(tok,"( {")) {
op.push(tok->next());
tok = tok->link()->next();
} else {
// Parenthesized sub-expression
tok = tok->next();

View File

@ -10008,6 +10008,10 @@ private:
ASSERT_EQUALS("'X''a'>", testAst("('X' > 'a')"));
ASSERT_EQUALS("'X''a'>", testAst("(L'X' > L'a')"));
// ({..})
ASSERT_EQUALS("a{+d+", testAst("a+({b+c;})+d"));
ASSERT_EQUALS("a{d*+", testAst("a+({b+c;})*d"));
}
void astpar() const { // parentheses