From e49e32d2ebf6701438680176aeb0f76fe1b81356 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 1 Nov 2018 14:17:52 +0100 Subject: C++: Fix Token::spell() In commit 86aab16ea4a45b1c67637f4504afdcbd7adfd261 TextEditor: Highlight punctuators as Text the order of tokens was changed, but the corresponding "spelling table" token_names was not adapted. As a result, e.g. Token::spell() returned "##" for the T_PLUS token. Fixes FAIL! : tst_Semantic::lambda_2() Compared strings are not the same FAIL! : tst_Semantic::enum_constantValue4() Compared strings are not the same FAIL! : tst_Semantic::enum_constantValueNegative() Compared strings are not the same FAIL! : tst_Semantic::enum_constantValueNegative() '!expectedConstantValue' returned FALSE. () FAIL! : tst_Semantic::enum_constantValueNegative() '!expectedConstantValue' returned FALSE. () FAIL! : tst_Semantic::enum_constantValueNegative() '!expectedConstantValue' returned FALSE. () Change-Id: If4c676bdb963f53fbc57f7d92f3d68341dd51eda Reviewed-by: Ivan Donchevskii --- src/libs/3rdparty/cplusplus/Token.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/libs/3rdparty/cplusplus') diff --git a/src/libs/3rdparty/cplusplus/Token.cpp b/src/libs/3rdparty/cplusplus/Token.cpp index 4017855c7f..ecc7a8487b 100644 --- a/src/libs/3rdparty/cplusplus/Token.cpp +++ b/src/libs/3rdparty/cplusplus/Token.cpp @@ -54,6 +54,20 @@ const char *token_names[] = { ("<@string literal>"), (""), + // punctuation + (":"), + ("::"), + (","), + (">"), + ("<"), + ("{"), + ("["), + ("("), + ("}"), + ("]"), + (")"), + (";"), + // operators ("&"), ("&&"), @@ -62,9 +76,6 @@ const char *token_names[] = { ("->*"), ("^"), ("^="), - (":"), - ("::"), - (","), ("/"), ("/="), ("."), @@ -74,17 +85,12 @@ const char *token_names[] = { ("=="), ("!"), ("!="), - (">"), (">="), (">>"), (">>="), - ("{"), - ("["), - ("<"), ("<="), ("<<"), ("<<="), - ("("), ("-"), ("-="), ("--"), @@ -99,10 +105,6 @@ const char *token_names[] = { ("#"), ("##"), ("?"), - ("}"), - ("]"), - (")"), - (";"), ("*"), ("*="), ("~"), -- cgit v1.2.3