Detect syntax error 'x ==> y'
This commit is contained in:
parent
32bf53eeda
commit
e8e3c2660d
|
@ -9629,6 +9629,8 @@ void Tokenizer::findGarbageCode() const
|
||||||
}
|
}
|
||||||
if (Token::Match(tok, "[!|+-/%^~] )|]"))
|
if (Token::Match(tok, "[!|+-/%^~] )|]"))
|
||||||
syntaxError(tok);
|
syntaxError(tok);
|
||||||
|
if (Token::Match(tok, "==|!=|<=|>= %comp%"))
|
||||||
|
syntaxError(tok, tok->str() + " " + tok->strAt(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ternary operator without :
|
// ternary operator without :
|
||||||
|
|
|
@ -8027,6 +8027,9 @@ private:
|
||||||
" struct { int d; } port[1]; "
|
" struct { int d; } port[1]; "
|
||||||
"}; "
|
"}; "
|
||||||
"struct poc p = { .port[0] = {.d = 3} };"));
|
"struct poc p = { .port[0] = {.d = 3} };"));
|
||||||
|
|
||||||
|
// op op
|
||||||
|
ASSERT_THROW_EQUALS(tokenizeAndStringify("void f() { dostuff (x==>y); }"), InternalError, "syntax error: == >");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue