| 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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 void ScanDecimalDigits(); | 670 void ScanDecimalDigits(); |
| 671 Token::Value ScanNumber(bool seen_period); | 671 Token::Value ScanNumber(bool seen_period); |
| 672 Token::Value ScanIdentifierOrKeyword(); | 672 Token::Value ScanIdentifierOrKeyword(); |
| 673 Token::Value ScanIdentifierSuffix(LiteralScope* literal); | 673 Token::Value ScanIdentifierSuffix(LiteralScope* literal); |
| 674 | 674 |
| 675 Token::Value ScanString(); | 675 Token::Value ScanString(); |
| 676 | 676 |
| 677 // Scans an escape-sequence which is part of a string and adds the | 677 // Scans an escape-sequence which is part of a string and adds the |
| 678 // decoded character to the current literal. Returns true if a pattern | 678 // decoded character to the current literal. Returns true if a pattern |
| 679 // is scanned. | 679 // is scanned. |
| 680 template <bool capture_raw> | 680 template <bool capture_raw, bool in_template_literal> |
| 681 bool ScanEscape(); | 681 bool ScanEscape(); |
| 682 |
| 682 // Decodes a Unicode escape-sequence which is part of an identifier. | 683 // Decodes a Unicode escape-sequence which is part of an identifier. |
| 683 // If the escape sequence cannot be decoded the result is kBadChar. | 684 // If the escape sequence cannot be decoded the result is kBadChar. |
| 684 uc32 ScanIdentifierUnicodeEscape(); | 685 uc32 ScanIdentifierUnicodeEscape(); |
| 685 // Helper for the above functions. | 686 // Helper for the above functions. |
| 686 template <bool capture_raw> | 687 template <bool capture_raw> |
| 687 uc32 ScanUnicodeEscape(); | 688 uc32 ScanUnicodeEscape(); |
| 688 | 689 |
| 689 Token::Value ScanTemplateSpan(); | 690 Token::Value ScanTemplateSpan(); |
| 690 | 691 |
| 691 // Return the current source position. | 692 // Return the current source position. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 bool harmony_classes_; | 737 bool harmony_classes_; |
| 737 // Whether we scan TEMPLATE_SPAN and TEMPLATE_TAIL | 738 // Whether we scan TEMPLATE_SPAN and TEMPLATE_TAIL |
| 738 bool harmony_templates_; | 739 bool harmony_templates_; |
| 739 // Whether we allow \u{xxxxx}. | 740 // Whether we allow \u{xxxxx}. |
| 740 bool harmony_unicode_; | 741 bool harmony_unicode_; |
| 741 }; | 742 }; |
| 742 | 743 |
| 743 } } // namespace v8::internal | 744 } } // namespace v8::internal |
| 744 | 745 |
| 745 #endif // V8_SCANNER_H_ | 746 #endif // V8_SCANNER_H_ |
| OLD | NEW |