forked from qt-creator/qt-creator
C++: Fix Token::spell()
In
commit 86aab16ea4
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>
This commit is contained in:
26
src/libs/3rdparty/cplusplus/Token.cpp
vendored
26
src/libs/3rdparty/cplusplus/Token.cpp
vendored
@@ -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[] = {
|
||||
("#"),
|
||||
("##"),
|
||||
("?"),
|
||||
("}"),
|
||||
("]"),
|
||||
(")"),
|
||||
(";"),
|
||||
("*"),
|
||||
("*="),
|
||||
("~"),
|
||||
|
Reference in New Issue
Block a user