Bug 900816 (part 5) - Rename some Token kinds. r=till.
authorNicholas Nethercote <nnethercote@mozilla.com>
Sun, 04 Aug 2013 15:30:14 -0700
changeset 153620 359fe5d08d5409d6139bee772c625efd83a44978
parent 153619 9fe517199cd2fcadacede758158b95c4d4d9a539
child 153621 4ab85b5ed58948ff56087ffcc475a5752e29f4bb
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs900816
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 900816 (part 5) - Rename some Token kinds. r=till.
js/src/frontend/Parser.cpp
js/src/frontend/TokenStream.cpp
js/src/frontend/TokenStream.h
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -5305,19 +5305,19 @@ Parser<ParseHandler>::unaryExpr()
       case TOK_TYPEOF:
         return unaryOpExpr(PNK_TYPEOF, JSOP_TYPEOF, begin);
       case TOK_VOID:
         return unaryOpExpr(PNK_VOID, JSOP_VOID, begin);
       case TOK_NOT:
         return unaryOpExpr(PNK_NOT, JSOP_NOT, begin);
       case TOK_BITNOT:
         return unaryOpExpr(PNK_BITNOT, JSOP_BITNOT, begin);
-      case TOK_PLUS:
+      case TOK_ADD:
         return unaryOpExpr(PNK_POS, JSOP_POS, begin);
-      case TOK_MINUS:
+      case TOK_SUB:
         return unaryOpExpr(PNK_NEG, JSOP_NEG, begin);
 
       case TOK_INC:
       case TOK_DEC:
       {
         TokenKind tt2 = tokenStream.getToken(TokenStream::Operand);
         pn2 = memberExpr(tt2, true);
         if (!pn2)
--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -1475,17 +1475,17 @@ TokenStream::getTokenInternal(Modifier m
         else
             tt = TOK_ASSIGN;
         goto out;
 
       case '+':
         if (matchChar('+'))
             tt = TOK_INC;
         else
-            tt = matchChar('=') ? TOK_ADDASSIGN : TOK_PLUS;
+            tt = matchChar('=') ? TOK_ADDASSIGN : TOK_ADD;
         goto out;
 
       case '\\':
         hadUnicodeEscape = matchUnicodeEscapeIdStart(&qc);
         if (hadUnicodeEscape) {
             identStart = userbuf.addressOfNextRawChar() - 6;
             goto identifier;
         }
@@ -1540,17 +1540,17 @@ TokenStream::getTokenInternal(Modifier m
             else
                 tt = matchChar('=') ? TOK_RSHASSIGN : TOK_RSH;
         } else {
             tt = matchChar('=') ? TOK_GE : TOK_GT;
         }
         goto out;
 
       case '*':
-        tt = matchChar('=') ? TOK_MULASSIGN : TOK_STAR;
+        tt = matchChar('=') ? TOK_MULASSIGN : TOK_MUL;
         goto out;
 
       case '/':
         /*
          * Look for a single-line comment.
          */
         if (matchChar('/')) {
             c = peekChar();
@@ -1659,17 +1659,17 @@ TokenStream::getTokenInternal(Modifier m
         goto out;
 
       case '-':
         if (matchChar('-')) {
             if (peekChar() == '>' && !flags.isDirtyLine)
                 goto skipline;
             tt = TOK_DEC;
         } else {
-            tt = matchChar('=') ? TOK_SUBASSIGN : TOK_MINUS;
+            tt = matchChar('=') ? TOK_SUBASSIGN : TOK_SUB;
         }
         goto out;
 
       badchar:
       default:
         reportError(JSMSG_ILLEGAL_CHARACTER);
         goto error;
     }
@@ -1750,19 +1750,19 @@ TokenKindToString(TokenKind tt)
       case TOK_COMMA:           return "TOK_COMMA";
       case TOK_HOOK:            return "TOK_HOOK";
       case TOK_COLON:           return "TOK_COLON";
       case TOK_OR:              return "TOK_OR";
       case TOK_AND:             return "TOK_AND";
       case TOK_BITOR:           return "TOK_BITOR";
       case TOK_BITXOR:          return "TOK_BITXOR";
       case TOK_BITAND:          return "TOK_BITAND";
-      case TOK_PLUS:            return "TOK_PLUS";
-      case TOK_MINUS:           return "TOK_MINUS";
-      case TOK_STAR:            return "TOK_STAR";
+      case TOK_ADD:             return "TOK_ADD";
+      case TOK_SUB:             return "TOK_SUB";
+      case TOK_MUL:             return "TOK_MUL";
       case TOK_DIV:             return "TOK_DIV";
       case TOK_MOD:             return "TOK_MOD";
       case TOK_INC:             return "TOK_INC";
       case TOK_DEC:             return "TOK_DEC";
       case TOK_DOT:             return "TOK_DOT";
       case TOK_TRIPLEDOT:       return "TOK_TRIPLEDOT";
       case TOK_LB:              return "TOK_LB";
       case TOK_RB:              return "TOK_RB";
--- a/js/src/frontend/TokenStream.h
+++ b/js/src/frontend/TokenStream.h
@@ -108,31 +108,31 @@ enum TokenKind {
     /* Relational ops (< <= > >=), per TokenKindIsRelational */
     TOK_LT,
     TOK_RELOP_START = TOK_LT,
     TOK_LE,
     TOK_GT,
     TOK_GE,
     TOK_RELOP_LAST = TOK_GE,
 
-    TOK_INSTANCEOF,                /* instanceof keyword */
-    TOK_IN,                        /* in keyword */
+    TOK_INSTANCEOF,                /* |instanceof| keyword */
+    TOK_IN,                        /* |in| keyword */
 
     /* Shift ops (<< >> >>>), per TokenKindIsShift */
     TOK_LSH,
     TOK_SHIFTOP_START = TOK_LSH,
     TOK_RSH,
     TOK_URSH,
     TOK_SHIFTOP_LAST = TOK_URSH,
 
-    TOK_PLUS,                      /* plus */
-    TOK_MINUS,                     /* minus */
-    TOK_STAR,                      /* multiply */
-    TOK_DIV,                       /* divide */
-    TOK_MOD,                       /* modulus */
+    TOK_ADD,
+    TOK_SUB,
+    TOK_MUL,
+    TOK_DIV,
+    TOK_MOD,
     TOK_BINOP_LAST = TOK_MOD,
 
     /* Unary operation tokens */
     TOK_TYPEOF,
     TOK_VOID,
     TOK_NOT,
     TOK_BITNOT,