Fixed #3183 (False positive: (error) syntax error)
This commit is contained in:
parent
175503ef94
commit
96beb94b21
|
@ -2389,6 +2389,14 @@ bool Tokenizer::tokenize(std::istream &code,
|
|||
break;
|
||||
}
|
||||
|
||||
// skip executing scopes (ticket #3183)..
|
||||
if (Token::simpleMatch(tok, "( {"))
|
||||
{
|
||||
tok = tok->next()->link();
|
||||
if (!tok)
|
||||
break;
|
||||
}
|
||||
|
||||
// skip executing scopes (ticket #1985)..
|
||||
if (Token::simpleMatch(tok, "try {"))
|
||||
{
|
||||
|
|
|
@ -4582,6 +4582,16 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
// ok code (ticket #3183)
|
||||
{
|
||||
errout.str();
|
||||
std::istringstream istr("MACRO(({ i < x }))");
|
||||
Settings settings;
|
||||
Tokenizer tokenizer(&settings, this);
|
||||
tokenizer.tokenize(istr, "test.cpp");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
// bad code.. missing ">"
|
||||
{
|
||||
errout.str("");
|
||||
|
|
Loading…
Reference in New Issue