Rephrased syntaxError message for empty configurations to improve readability:
Old: Invalid number of character 'c' when these macros are defined: ''. New: Invalid number of character 'c' when no macros are defined.
This commit is contained in:
parent
ad96f7b519
commit
084fcc936c
|
@ -7570,9 +7570,13 @@ void Tokenizer::syntaxError(const Token *tok) const
|
||||||
void Tokenizer::syntaxError(const Token *tok, char c) const
|
void Tokenizer::syntaxError(const Token *tok, char c) const
|
||||||
{
|
{
|
||||||
printDebugOutput(0);
|
printDebugOutput(0);
|
||||||
|
if (_configuration.empty())
|
||||||
throw InternalError(tok,
|
throw InternalError(tok,
|
||||||
std::string("Invalid number of character '") + c + "' " +
|
std::string("Invalid number of character '") + c + "' when no macros are defined.",
|
||||||
"when these macros are defined: '" + _configuration + "'.",
|
InternalError::SYNTAX);
|
||||||
|
else
|
||||||
|
throw InternalError(tok,
|
||||||
|
std::string("Invalid number of character '") + c + "' when these macros are defined: '" + _configuration + "'.",
|
||||||
InternalError::SYNTAX);
|
InternalError::SYNTAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
[samples\syntaxError\bad.c:2]: (error) Invalid number of character '{' when these macros are defined: ''.
|
[samples\syntaxError\bad.c:2]: (error) Invalid number of character '{' when no macros are defined.
|
||||||
|
|
|
@ -1073,7 +1073,7 @@ private:
|
||||||
tokenizer.tokenize(istr, "test.cpp");
|
tokenizer.tokenize(istr, "test.cpp");
|
||||||
assertThrowFail(__FILE__, __LINE__);
|
assertThrowFail(__FILE__, __LINE__);
|
||||||
} catch (InternalError& e) {
|
} catch (InternalError& e) {
|
||||||
ASSERT_EQUALS("Invalid number of character '(' when these macros are defined: ''.", e.errorMessage);
|
ASSERT_EQUALS("Invalid number of character '(' when no macros are defined.", e.errorMessage);
|
||||||
ASSERT_EQUALS("syntaxError", e.id);
|
ASSERT_EQUALS("syntaxError", e.id);
|
||||||
ASSERT_EQUALS(2, e.token->linenr());
|
ASSERT_EQUALS(2, e.token->linenr());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue