| 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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 | 630 |
| 631 Token::Value ScanString(); | 631 Token::Value ScanString(); |
| 632 | 632 |
| 633 // Scans an escape-sequence which is part of a string and adds the | 633 // Scans an escape-sequence which is part of a string and adds the |
| 634 // decoded character to the current literal. Returns true if a pattern | 634 // decoded character to the current literal. Returns true if a pattern |
| 635 // is scanned. | 635 // is scanned. |
| 636 bool ScanEscape(); | 636 bool ScanEscape(); |
| 637 // Decodes a Unicode escape-sequence which is part of an identifier. | 637 // Decodes a Unicode escape-sequence which is part of an identifier. |
| 638 // If the escape sequence cannot be decoded the result is kBadChar. | 638 // If the escape sequence cannot be decoded the result is kBadChar. |
| 639 uc32 ScanIdentifierUnicodeEscape(); | 639 uc32 ScanIdentifierUnicodeEscape(); |
| 640 // Scans a Unicode escape-sequence and adds its characters, | |
| 641 // uninterpreted, to the current literal. Used for parsing RegExp | |
| 642 // flags. | |
| 643 bool ScanLiteralUnicodeEscape(); | |
| 644 | 640 |
| 645 // Return the current source position. | 641 // Return the current source position. |
| 646 int source_pos() { | 642 int source_pos() { |
| 647 return source_->pos() - kCharacterLookaheadBufferSize; | 643 return source_->pos() - kCharacterLookaheadBufferSize; |
| 648 } | 644 } |
| 649 | 645 |
| 650 UnicodeCache* unicode_cache_; | 646 UnicodeCache* unicode_cache_; |
| 651 | 647 |
| 652 // Buffers collecting literal strings, numbers, etc. | 648 // Buffers collecting literal strings, numbers, etc. |
| 653 LiteralBuffer literal_buffer1_; | 649 LiteralBuffer literal_buffer1_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 683 bool harmony_modules_; | 679 bool harmony_modules_; |
| 684 // Whether we scan 0o777 and 0b111 as numbers. | 680 // Whether we scan 0o777 and 0b111 as numbers. |
| 685 bool harmony_numeric_literals_; | 681 bool harmony_numeric_literals_; |
| 686 // Whether we scan 'class', 'extends', 'static' and 'super' as keywords. | 682 // Whether we scan 'class', 'extends', 'static' and 'super' as keywords. |
| 687 bool harmony_classes_; | 683 bool harmony_classes_; |
| 688 }; | 684 }; |
| 689 | 685 |
| 690 } } // namespace v8::internal | 686 } } // namespace v8::internal |
| 691 | 687 |
| 692 #endif // V8_SCANNER_H_ | 688 #endif // V8_SCANNER_H_ |
| OLD | NEW |