From 83ee6409770347e335f66138f5f2b762983b19b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Fri, 31 Jul 2015 13:31:11 +0200 Subject: [PATCH] Tokenizer::syntaxError: put the character that we have an invalid number of into singlequotes instead of parentheses. --- lib/tokenize.cpp | 2 +- samples/syntaxError/out.txt | 2 +- test/testtokenize.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index e5000aa94..d35615700 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -8253,7 +8253,7 @@ void Tokenizer::syntaxError(const Token *tok, char c) const { printDebugOutput(0); throw InternalError(tok, - std::string("Invalid number of character (") + c + ") " + + std::string("Invalid number of character '") + c + "' " + "when these macros are defined: '" + _configuration + "'.", InternalError::SYNTAX); } diff --git a/samples/syntaxError/out.txt b/samples/syntaxError/out.txt index 5689c3a20..eafd9d47b 100644 --- a/samples/syntaxError/out.txt +++ b/samples/syntaxError/out.txt @@ -1 +1 @@ -[samples\syntaxError\bad.c:2]: (error) Invalid number of character ({) when these macros are defined: 'A'. +[samples\syntaxError\bad.c:2]: (error) Invalid number of character '{' when these macros are defined: 'A'. diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index ea9f559ff..27e118696 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -4190,7 +4190,7 @@ private: tokenizer.tokenize(istr, "test.cpp"); assertThrowFail(__FILE__, __LINE__); } catch (InternalError& e) { - ASSERT_EQUALS("Invalid number of character (() when these macros are defined: ''.", e.errorMessage); + ASSERT_EQUALS("Invalid number of character '(' when these macros are defined: ''.", e.errorMessage); ASSERT_EQUALS("syntaxError", e.id); ASSERT_EQUALS(2, e.token->linenr()); }