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:
Nikolai Kosjar
2018-11-01 14:17:52 +01:00
parent 6e7ecdb4f1
commit e49e32d2eb

View File

@@ -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[] = {
("#"),
("##"),
("?"),
("}"),
("]"),
(")"),
(";"),
("*"),
("*="),
("~"),