Syntax error: Clarify a syntax error in audacity

This commit is contained in:
Daniel Marjamäki 2019-03-31 10:46:59 +02:00
parent b30d463baf
commit 73433c2961
2 changed files with 2 additions and 2 deletions

View File

@ -9060,7 +9060,7 @@ void Tokenizer::findGarbageCode() const
while (prev && prev->isName())
prev = prev->previous();
if (Token::Match(prev, "%op%|%num%|%str%|%char%"))
syntaxError(tok);
syntaxError(tok, prev == tok->previous() ? (prev->str() + " " + tok->str()) : (prev->str() + " .. " + tok->str()));
}
// case keyword must be inside switch

View File

@ -1656,7 +1656,7 @@ private:
void syntaxErrorFuzzerCliType1() {
ASSERT_THROW(checkCode("void f(){x=0,return return''[]()}"), InternalError);
ASSERT_THROW(checkCode("void f(){x='0'++'0'(return)[];}"), InternalError); // #9063
checkCode("void f(){*(int *)42=0;}");
checkCode("void f(){*(int *)42=0;}"); // no syntax error
ASSERT_THROW(checkCode("void f() { x= 'x' > typedef name5 | ( , ;){ } (); }"), InternalError); // #9067
ASSERT_THROW(checkCode("void f() { x= {}( ) ( 'x')[ ] (); }"), InternalError); // #9068
ASSERT_THROW(checkCode("void f() { x= y{ } name5 y[ ] + y ^ name5 ^ name5 for ( ( y y y && y y y && name5 ++ int )); }"), InternalError); // #9069