aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2018-11-01 14:17:52 +0100
committerNikolai Kosjar <nikolai.kosjar@qt.io>2018-11-02 14:12:15 +0000
commite49e32d2ebf6701438680176aeb0f76fe1b81356 (patch)
tree027e99a27bd9f81c6de2ee2a24a523b80d434dff /src/libs/3rdparty/cplusplus
parent6e7ecdb4f1ab6a088258748dba8abf74d9f194e4 (diff)
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 <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/libs/3rdparty/cplusplus')
-rw-r--r--src/libs/3rdparty/cplusplus/Token.cpp26
1 files changed, 14 insertions, 12 deletions
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>"),
("<angle 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[] = {
("#"),
("##"),
("?"),
- ("}"),
- ("]"),
- (")"),
- (";"),
("*"),
("*="),
("~"),