Skip to content

Commit 83ee640

Browse files
committed
Tokenizer::syntaxError: put the character that we have an invalid number of into singlequotes instead of parentheses.
1 parent 87891b4 commit 83ee640

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/tokenize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8253,7 +8253,7 @@ void Tokenizer::syntaxError(const Token *tok, char c) const
82538253
{
82548254
printDebugOutput(0);
82558255
throw InternalError(tok,
8256-
std::string("Invalid number of character (") + c + ") " +
8256+
std::string("Invalid number of character '") + c + "' " +
82578257
"when these macros are defined: '" + _configuration + "'.",
82588258
InternalError::SYNTAX);
82598259
}

samples/syntaxError/out.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[samples\syntaxError\bad.c:2]: (error) Invalid number of character ({) when these macros are defined: 'A'.
1+
[samples\syntaxError\bad.c:2]: (error) Invalid number of character '{' when these macros are defined: 'A'.

test/testtokenize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4190,7 +4190,7 @@ class TestTokenizer : public TestFixture {
41904190
tokenizer.tokenize(istr, "test.cpp");
41914191
assertThrowFail(__FILE__, __LINE__);
41924192
} catch (InternalError& e) {
4193-
ASSERT_EQUALS("Invalid number of character (() when these macros are defined: ''.", e.errorMessage);
4193+
ASSERT_EQUALS("Invalid number of character '(' when these macros are defined: ''.", e.errorMessage);
41944194
ASSERT_EQUALS("syntaxError", e.id);
41954195
ASSERT_EQUALS(2, e.token->linenr());
41964196
}

0 commit comments

Comments
 (0)