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_PARSING_SCANNER_H_ | 7 #ifndef V8_PARSING_SCANNER_H_ |
8 #define V8_PARSING_SCANNER_H_ | 8 #define V8_PARSING_SCANNER_H_ |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 | 443 |
444 const LiteralBuffer* source_url() const { return &source_url_; } | 444 const LiteralBuffer* source_url() const { return &source_url_; } |
445 const LiteralBuffer* source_mapping_url() const { | 445 const LiteralBuffer* source_mapping_url() const { |
446 return &source_mapping_url_; | 446 return &source_mapping_url_; |
447 } | 447 } |
448 | 448 |
449 bool IdentifierIsFutureStrictReserved(const AstRawString* string) const; | 449 bool IdentifierIsFutureStrictReserved(const AstRawString* string) const; |
450 | 450 |
451 bool FoundHtmlComment() const { return found_html_comment_; } | 451 bool FoundHtmlComment() const { return found_html_comment_; } |
452 | 452 |
| 453 #define DECLARE_ACCESSORS(name) \ |
| 454 inline bool allow_##name() const { return allow_##name##_; } \ |
| 455 inline void set_allow_##name(bool allow) { allow_##name##_ = allow; } |
| 456 DECLARE_ACCESSORS(harmony_exponentiation_operator) |
| 457 #undef ACCESSOR |
| 458 |
453 private: | 459 private: |
454 // The current and look-ahead token. | 460 // The current and look-ahead token. |
455 struct TokenDesc { | 461 struct TokenDesc { |
456 Token::Value token; | 462 Token::Value token; |
457 Location location; | 463 Location location; |
458 LiteralBuffer* literal_chars; | 464 LiteralBuffer* literal_chars; |
459 LiteralBuffer* raw_literal_chars; | 465 LiteralBuffer* raw_literal_chars; |
460 int smi_value_; | 466 int smi_value_; |
461 }; | 467 }; |
462 | 468 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 // Whether there is a line terminator whitespace character after | 757 // Whether there is a line terminator whitespace character after |
752 // the current token, and before the next. Does not count newlines | 758 // the current token, and before the next. Does not count newlines |
753 // inside multiline comments. | 759 // inside multiline comments. |
754 bool has_line_terminator_before_next_; | 760 bool has_line_terminator_before_next_; |
755 // Whether there is a multi-line comment that contains a | 761 // Whether there is a multi-line comment that contains a |
756 // line-terminator after the current token, and before the next. | 762 // line-terminator after the current token, and before the next. |
757 bool has_multiline_comment_before_next_; | 763 bool has_multiline_comment_before_next_; |
758 | 764 |
759 // Whether this scanner encountered an HTML comment. | 765 // Whether this scanner encountered an HTML comment. |
760 bool found_html_comment_; | 766 bool found_html_comment_; |
| 767 |
| 768 bool allow_harmony_exponentiation_operator_; |
761 }; | 769 }; |
762 | 770 |
763 } // namespace internal | 771 } // namespace internal |
764 } // namespace v8 | 772 } // namespace v8 |
765 | 773 |
766 #endif // V8_PARSING_SCANNER_H_ | 774 #endif // V8_PARSING_SCANNER_H_ |
OLD | NEW |