AST: Fixed handling of 'a=b(c**)+1'
This commit is contained in:
parent
c34616a6ba
commit
11856b51aa
|
@ -596,8 +596,11 @@ static void compileMulDiv(Token *&tok, std::stack<Token*> &op, unsigned int dept
|
|||
compileDot(tok,op, depth);
|
||||
while (tok) {
|
||||
if (Token::Match(tok, "[*/%]")) {
|
||||
if (Token::Match(tok, "* [,)]"))
|
||||
if (Token::Match(tok, "* [*,)]")) {
|
||||
while (tok->next() && tok->str() == "*")
|
||||
tok = tok->next();
|
||||
break;
|
||||
}
|
||||
compileBinOp(tok, compileDot, op, depth);
|
||||
} else break;
|
||||
}
|
||||
|
|
|
@ -10345,6 +10345,7 @@ private:
|
|||
" `-f\n",
|
||||
testAst("x = ((a[i]).f)();", true));
|
||||
ASSERT_EQUALS("abcde.++[.=", testAst("a = b.c[++(d.e)];"));
|
||||
ASSERT_EQUALS("abc(1+=", testAst("a = b(c**)+1;"));
|
||||
|
||||
// casts
|
||||
ASSERT_EQUALS("a1(2(+=",testAst("a=(t)1+(t)2;"));
|
||||
|
|
Loading…
Reference in New Issue