| 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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 has_multiline_comment_before_next_; | 444 has_multiline_comment_before_next_; |
| 445 } | 445 } |
| 446 | 446 |
| 447 // Scans the input as a regular expression pattern, previous | 447 // Scans the input as a regular expression pattern, previous |
| 448 // character(s) must be /(=). Returns true if a pattern is scanned. | 448 // character(s) must be /(=). Returns true if a pattern is scanned. |
| 449 bool ScanRegExpPattern(bool seen_equal); | 449 bool ScanRegExpPattern(bool seen_equal); |
| 450 // Returns true if regexp flags are scanned (always since flags can | 450 // Returns true if regexp flags are scanned (always since flags can |
| 451 // be empty). | 451 // be empty). |
| 452 bool ScanRegExpFlags(); | 452 bool ScanRegExpFlags(); |
| 453 | 453 |
| 454 bool IdentifierIsFutureStrictReserved(const AstRawString* string) const; |
| 455 |
| 454 private: | 456 private: |
| 455 // The current and look-ahead token. | 457 // The current and look-ahead token. |
| 456 struct TokenDesc { | 458 struct TokenDesc { |
| 457 Token::Value token; | 459 Token::Value token; |
| 458 Location location; | 460 Location location; |
| 459 LiteralBuffer* literal_chars; | 461 LiteralBuffer* literal_chars; |
| 460 }; | 462 }; |
| 461 | 463 |
| 462 static const int kCharacterLookaheadBufferSize = 1; | 464 static const int kCharacterLookaheadBufferSize = 1; |
| 463 | 465 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 // line-terminator after the current token, and before the next. | 629 // line-terminator after the current token, and before the next. |
| 628 bool has_multiline_comment_before_next_; | 630 bool has_multiline_comment_before_next_; |
| 629 // Whether we scan 'let' as a keyword for harmony block-scoped let bindings. | 631 // Whether we scan 'let' as a keyword for harmony block-scoped let bindings. |
| 630 bool harmony_scoping_; | 632 bool harmony_scoping_; |
| 631 // Whether we scan 'module', 'import', 'export' as keywords. | 633 // Whether we scan 'module', 'import', 'export' as keywords. |
| 632 bool harmony_modules_; | 634 bool harmony_modules_; |
| 633 // Whether we scan 0o777 and 0b111 as numbers. | 635 // Whether we scan 0o777 and 0b111 as numbers. |
| 634 bool harmony_numeric_literals_; | 636 bool harmony_numeric_literals_; |
| 635 }; | 637 }; |
| 636 | 638 |
| 639 |
| 637 } } // namespace v8::internal | 640 } } // namespace v8::internal |
| 638 | 641 |
| 639 #endif // V8_SCANNER_H_ | 642 #endif // V8_SCANNER_H_ |
| OLD | NEW |