| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_TOKEN_H_ | 5 #ifndef V8_TOKEN_H_ |
| 6 #define V8_TOKEN_H_ | 6 #define V8_TOKEN_H_ |
| 7 | 7 |
| 8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 /* Punctuators (ECMA-262, section 7.7, page 15). */ \ | 33 /* Punctuators (ECMA-262, section 7.7, page 15). */ \ |
| 34 T(LPAREN, "(", 0) \ | 34 T(LPAREN, "(", 0) \ |
| 35 T(RPAREN, ")", 0) \ | 35 T(RPAREN, ")", 0) \ |
| 36 T(LBRACK, "[", 0) \ | 36 T(LBRACK, "[", 0) \ |
| 37 T(RBRACK, "]", 0) \ | 37 T(RBRACK, "]", 0) \ |
| 38 T(LBRACE, "{", 0) \ | 38 T(LBRACE, "{", 0) \ |
| 39 T(RBRACE, "}", 0) \ | 39 T(RBRACE, "}", 0) \ |
| 40 T(COLON, ":", 0) \ | 40 T(COLON, ":", 0) \ |
| 41 T(SEMICOLON, ";", 0) \ | 41 T(SEMICOLON, ";", 0) \ |
| 42 T(PERIOD, ".", 0) \ | 42 T(PERIOD, ".", 0) \ |
| 43 T(ELLIPSIS, "...", 0) \ | 43 T(ELLIPSIS, "...", 0) \ |
| 44 T(CONDITIONAL, "?", 3) \ | 44 T(CONDITIONAL, "?", 3) \ |
| 45 T(INC, "++", 0) \ | 45 T(INC, "++", 0) \ |
| 46 T(DEC, "--", 0) \ | 46 T(DEC, "--", 0) \ |
| 47 T(ARROW, "=>", 0) \ | 47 T(ARROW, "=>", 0) \ |
| 48 \ | 48 \ |
| 49 /* Assignment operators. */ \ | 49 /* Assignment operators. */ \ |
| 50 /* IsAssignmentOp() and Assignment::is_compound() relies on */ \ | 50 /* IsAssignmentOp() and Assignment::is_compound() relies on */ \ |
| 51 /* this block of enum values being contiguous and sorted in the */ \ | 51 /* this block of enum values being contiguous and sorted in the */ \ |
| 52 /* same order! */ \ | 52 /* same order! */ \ |
| 53 T(INIT_VAR, "=init_var", 2) /* AST-use only. */ \ | 53 T(INIT_VAR, "=init_var", 2) /* AST-use only. */ \ |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 K(VAR, "var", 0) \ | 135 K(VAR, "var", 0) \ |
| 136 /* VOID */ \ | 136 /* VOID */ \ |
| 137 K(WHILE, "while", 0) \ | 137 K(WHILE, "while", 0) \ |
| 138 K(WITH, "with", 0) \ | 138 K(WITH, "with", 0) \ |
| 139 \ | 139 \ |
| 140 /* Literals (ECMA-262, section 7.8, page 16). */ \ | 140 /* Literals (ECMA-262, section 7.8, page 16). */ \ |
| 141 K(NULL_LITERAL, "null", 0) \ | 141 K(NULL_LITERAL, "null", 0) \ |
| 142 K(TRUE_LITERAL, "true", 0) \ | 142 K(TRUE_LITERAL, "true", 0) \ |
| 143 K(FALSE_LITERAL, "false", 0) \ | 143 K(FALSE_LITERAL, "false", 0) \ |
| 144 T(NUMBER, NULL, 0) \ | 144 T(NUMBER, NULL, 0) \ |
| 145 T(SMI, NULL, 0) \ |
| 145 T(STRING, NULL, 0) \ | 146 T(STRING, NULL, 0) \ |
| 146 \ | 147 \ |
| 147 /* Identifiers (not keywords or future reserved words). */ \ | 148 /* Identifiers (not keywords or future reserved words). */ \ |
| 148 T(IDENTIFIER, NULL, 0) \ | 149 T(IDENTIFIER, NULL, 0) \ |
| 149 \ | 150 \ |
| 150 /* Future reserved words (ECMA-262, section 7.6.1.2). */ \ | 151 /* Future reserved words (ECMA-262, section 7.6.1.2). */ \ |
| 151 T(FUTURE_RESERVED_WORD, NULL, 0) \ | 152 T(FUTURE_RESERVED_WORD, NULL, 0) \ |
| 152 T(FUTURE_STRICT_RESERVED_WORD, NULL, 0) \ | 153 T(FUTURE_STRICT_RESERVED_WORD, NULL, 0) \ |
| 153 K(CLASS, "class", 0) \ | 154 K(CLASS, "class", 0) \ |
| 154 K(CONST, "const", 0) \ | 155 K(CONST, "const", 0) \ |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 private: | 313 private: |
| 313 static const char* const name_[NUM_TOKENS]; | 314 static const char* const name_[NUM_TOKENS]; |
| 314 static const char* const string_[NUM_TOKENS]; | 315 static const char* const string_[NUM_TOKENS]; |
| 315 static const int8_t precedence_[NUM_TOKENS]; | 316 static const int8_t precedence_[NUM_TOKENS]; |
| 316 static const char token_type[NUM_TOKENS]; | 317 static const char token_type[NUM_TOKENS]; |
| 317 }; | 318 }; |
| 318 | 319 |
| 319 } } // namespace v8::internal | 320 } } // namespace v8::internal |
| 320 | 321 |
| 321 #endif // V8_TOKEN_H_ | 322 #endif // V8_TOKEN_H_ |
| OLD | NEW |