| 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 // Helper for the above functions. |
| 641 uc32 ScanUnicodeEscape(); |
| 640 | 642 |
| 641 // Return the current source position. | 643 // Return the current source position. |
| 642 int source_pos() { | 644 int source_pos() { |
| 643 return source_->pos() - kCharacterLookaheadBufferSize; | 645 return source_->pos() - kCharacterLookaheadBufferSize; |
| 644 } | 646 } |
| 645 | 647 |
| 646 UnicodeCache* unicode_cache_; | 648 UnicodeCache* unicode_cache_; |
| 647 | 649 |
| 648 // Buffers collecting literal strings, numbers, etc. | 650 // Buffers collecting literal strings, numbers, etc. |
| 649 LiteralBuffer literal_buffer1_; | 651 LiteralBuffer literal_buffer1_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 679 bool harmony_modules_; | 681 bool harmony_modules_; |
| 680 // Whether we scan 0o777 and 0b111 as numbers. | 682 // Whether we scan 0o777 and 0b111 as numbers. |
| 681 bool harmony_numeric_literals_; | 683 bool harmony_numeric_literals_; |
| 682 // Whether we scan 'class', 'extends', 'static' and 'super' as keywords. | 684 // Whether we scan 'class', 'extends', 'static' and 'super' as keywords. |
| 683 bool harmony_classes_; | 685 bool harmony_classes_; |
| 684 }; | 686 }; |
| 685 | 687 |
| 686 } } // namespace v8::internal | 688 } } // namespace v8::internal |
| 687 | 689 |
| 688 #endif // V8_SCANNER_H_ | 690 #endif // V8_SCANNER_H_ |
| OLD | NEW |