OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 // Features shared by parsing and pre-parsing scanners. | 5 // Features shared by parsing and pre-parsing scanners. |
6 | 6 |
7 #ifndef V8_SCANNER_H_ | 7 #ifndef V8_SCANNER_H_ |
8 #define V8_SCANNER_H_ | 8 #define V8_SCANNER_H_ |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 } | 431 } |
432 void SetHarmonyModules(bool modules) { | 432 void SetHarmonyModules(bool modules) { |
433 harmony_modules_ = modules; | 433 harmony_modules_ = modules; |
434 } | 434 } |
435 bool HarmonyNumericLiterals() const { | 435 bool HarmonyNumericLiterals() const { |
436 return harmony_numeric_literals_; | 436 return harmony_numeric_literals_; |
437 } | 437 } |
438 void SetHarmonyNumericLiterals(bool numeric_literals) { | 438 void SetHarmonyNumericLiterals(bool numeric_literals) { |
439 harmony_numeric_literals_ = numeric_literals; | 439 harmony_numeric_literals_ = numeric_literals; |
440 } | 440 } |
| 441 bool HarmonyClasses() const { |
| 442 return harmony_classes_; |
| 443 } |
| 444 void SetHarmonyClasses(bool classes) { |
| 445 harmony_classes_ = classes; |
| 446 } |
441 | 447 |
442 // Returns true if there was a line terminator before the peek'ed token, | 448 // Returns true if there was a line terminator before the peek'ed token, |
443 // possibly inside a multi-line comment. | 449 // possibly inside a multi-line comment. |
444 bool HasAnyLineTerminatorBeforeNext() const { | 450 bool HasAnyLineTerminatorBeforeNext() const { |
445 return has_line_terminator_before_next_ || | 451 return has_line_terminator_before_next_ || |
446 has_multiline_comment_before_next_; | 452 has_multiline_comment_before_next_; |
447 } | 453 } |
448 | 454 |
449 // Scans the input as a regular expression pattern, previous | 455 // Scans the input as a regular expression pattern, previous |
450 // character(s) must be /(=). Returns true if a pattern is scanned. | 456 // character(s) must be /(=). Returns true if a pattern is scanned. |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 bool has_line_terminator_before_next_; | 646 bool has_line_terminator_before_next_; |
641 // Whether there is a multi-line comment that contains a | 647 // Whether there is a multi-line comment that contains a |
642 // line-terminator after the current token, and before the next. | 648 // line-terminator after the current token, and before the next. |
643 bool has_multiline_comment_before_next_; | 649 bool has_multiline_comment_before_next_; |
644 // Whether we scan 'let' as a keyword for harmony block-scoped let bindings. | 650 // Whether we scan 'let' as a keyword for harmony block-scoped let bindings. |
645 bool harmony_scoping_; | 651 bool harmony_scoping_; |
646 // Whether we scan 'module', 'import', 'export' as keywords. | 652 // Whether we scan 'module', 'import', 'export' as keywords. |
647 bool harmony_modules_; | 653 bool harmony_modules_; |
648 // Whether we scan 0o777 and 0b111 as numbers. | 654 // Whether we scan 0o777 and 0b111 as numbers. |
649 bool harmony_numeric_literals_; | 655 bool harmony_numeric_literals_; |
| 656 // Whether we scan 'super' as keyword. |
| 657 bool harmony_classes_; |
650 }; | 658 }; |
651 | 659 |
652 } } // namespace v8::internal | 660 } } // namespace v8::internal |
653 | 661 |
654 #endif // V8_SCANNER_H_ | 662 #endif // V8_SCANNER_H_ |
OLD | NEW |