diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index c572fd2df..b2dd8f01b 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -478,6 +478,9 @@ static void compileTerm(Token *& tok, std::stack &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(); diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 0cddf01fb..8310f5d57 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -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