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 145 matching lines...) Loading... |
156 K(IMPORT, "import", 0) \ | 156 K(IMPORT, "import", 0) \ |
157 K(LET, "let", 0) \ | 157 K(LET, "let", 0) \ |
158 K(STATIC, "static", 0) \ | 158 K(STATIC, "static", 0) \ |
159 K(YIELD, "yield", 0) \ | 159 K(YIELD, "yield", 0) \ |
160 K(SUPER, "super", 0) \ | 160 K(SUPER, "super", 0) \ |
161 \ | 161 \ |
162 /* Illegal token - not able to scan. */ \ | 162 /* Illegal token - not able to scan. */ \ |
163 T(ILLEGAL, "ILLEGAL", 0) \ | 163 T(ILLEGAL, "ILLEGAL", 0) \ |
164 \ | 164 \ |
165 /* Scanner-internal use only. */ \ | 165 /* Scanner-internal use only. */ \ |
166 T(WHITESPACE, NULL, 0) | 166 T(WHITESPACE, NULL, 0) \ |
| 167 \ |
| 168 /* ES6 Template Literals */ \ |
| 169 T(TEMPLATE_SPAN, NULL, 0) \ |
| 170 T(TEMPLATE_TAIL, NULL, 0) |
167 | 171 |
168 | 172 |
169 class Token { | 173 class Token { |
170 public: | 174 public: |
171 // All token values. | 175 // All token values. |
172 #define T(name, string, precedence) name, | 176 #define T(name, string, precedence) name, |
173 enum Value { | 177 enum Value { |
174 TOKEN_LIST(T, T) | 178 TOKEN_LIST(T, T) |
175 NUM_TOKENS | 179 NUM_TOKENS |
176 }; | 180 }; |
(...skipping 130 matching lines...) Loading... |
307 private: | 311 private: |
308 static const char* const name_[NUM_TOKENS]; | 312 static const char* const name_[NUM_TOKENS]; |
309 static const char* const string_[NUM_TOKENS]; | 313 static const char* const string_[NUM_TOKENS]; |
310 static const int8_t precedence_[NUM_TOKENS]; | 314 static const int8_t precedence_[NUM_TOKENS]; |
311 static const char token_type[NUM_TOKENS]; | 315 static const char token_type[NUM_TOKENS]; |
312 }; | 316 }; |
313 | 317 |
314 } } // namespace v8::internal | 318 } } // namespace v8::internal |
315 | 319 |
316 #endif // V8_TOKEN_H_ | 320 #endif // V8_TOKEN_H_ |
OLD | NEW |