| 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 // tokens, which is what it is used for. | 478 // tokens, which is what it is used for. |
| 479 void SeekForward(int pos); | 479 void SeekForward(int pos); |
| 480 | 480 |
| 481 bool HarmonyModules() const { | 481 bool HarmonyModules() const { |
| 482 return harmony_modules_; | 482 return harmony_modules_; |
| 483 } | 483 } |
| 484 void SetHarmonyModules(bool modules) { | 484 void SetHarmonyModules(bool modules) { |
| 485 harmony_modules_ = modules; | 485 harmony_modules_ = modules; |
| 486 } | 486 } |
| 487 | 487 |
| 488 bool HarmonyUnicode() const { return harmony_unicode_; } | |
| 489 void SetHarmonyUnicode(bool unicode) { harmony_unicode_ = unicode; } | |
| 490 | |
| 491 // Returns true if there was a line terminator before the peek'ed token, | 488 // Returns true if there was a line terminator before the peek'ed token, |
| 492 // possibly inside a multi-line comment. | 489 // possibly inside a multi-line comment. |
| 493 bool HasAnyLineTerminatorBeforeNext() const { | 490 bool HasAnyLineTerminatorBeforeNext() const { |
| 494 return has_line_terminator_before_next_ || | 491 return has_line_terminator_before_next_ || |
| 495 has_multiline_comment_before_next_; | 492 has_multiline_comment_before_next_; |
| 496 } | 493 } |
| 497 | 494 |
| 498 // Scans the input as a regular expression pattern, previous | 495 // Scans the input as a regular expression pattern, previous |
| 499 // character(s) must be /(=). Returns true if a pattern is scanned. | 496 // character(s) must be /(=). Returns true if a pattern is scanned. |
| 500 bool ScanRegExpPattern(bool seen_equal); | 497 bool ScanRegExpPattern(bool seen_equal); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 | 789 |
| 793 // Whether there is a line terminator whitespace character after | 790 // Whether there is a line terminator whitespace character after |
| 794 // the current token, and before the next. Does not count newlines | 791 // the current token, and before the next. Does not count newlines |
| 795 // inside multiline comments. | 792 // inside multiline comments. |
| 796 bool has_line_terminator_before_next_; | 793 bool has_line_terminator_before_next_; |
| 797 // Whether there is a multi-line comment that contains a | 794 // Whether there is a multi-line comment that contains a |
| 798 // line-terminator after the current token, and before the next. | 795 // line-terminator after the current token, and before the next. |
| 799 bool has_multiline_comment_before_next_; | 796 bool has_multiline_comment_before_next_; |
| 800 // Whether we scan 'module', 'import', 'export' as keywords. | 797 // Whether we scan 'module', 'import', 'export' as keywords. |
| 801 bool harmony_modules_; | 798 bool harmony_modules_; |
| 802 // Whether we allow \u{xxxxx}. | |
| 803 bool harmony_unicode_; | |
| 804 }; | 799 }; |
| 805 | 800 |
| 806 } } // namespace v8::internal | 801 } } // namespace v8::internal |
| 807 | 802 |
| 808 #endif // V8_SCANNER_H_ | 803 #endif // V8_SCANNER_H_ |
| OLD | NEW |