| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 bool is_next_contextual_keyword(Vector<const char> keyword) { | 428 bool is_next_contextual_keyword(Vector<const char> keyword) { |
| 429 DCHECK_NOT_NULL(next_.literal_chars); | 429 DCHECK_NOT_NULL(next_.literal_chars); |
| 430 return next_.literal_chars->is_contextual_keyword(keyword); | 430 return next_.literal_chars->is_contextual_keyword(keyword); |
| 431 } | 431 } |
| 432 | 432 |
| 433 const AstRawString* CurrentSymbol(AstValueFactory* ast_value_factory); | 433 const AstRawString* CurrentSymbol(AstValueFactory* ast_value_factory); |
| 434 const AstRawString* NextSymbol(AstValueFactory* ast_value_factory); | 434 const AstRawString* NextSymbol(AstValueFactory* ast_value_factory); |
| 435 const AstRawString* CurrentRawSymbol(AstValueFactory* ast_value_factory); | 435 const AstRawString* CurrentRawSymbol(AstValueFactory* ast_value_factory); |
| 436 | 436 |
| 437 double DoubleValue(); | 437 double DoubleValue(); |
| 438 bool ContainsDot(); |
| 438 bool LiteralMatches(const char* data, int length, bool allow_escapes = true) { | 439 bool LiteralMatches(const char* data, int length, bool allow_escapes = true) { |
| 439 if (is_literal_one_byte() && | 440 if (is_literal_one_byte() && |
| 440 literal_length() == length && | 441 literal_length() == length && |
| 441 (allow_escapes || !literal_contains_escapes())) { | 442 (allow_escapes || !literal_contains_escapes())) { |
| 442 const char* token = | 443 const char* token = |
| 443 reinterpret_cast<const char*>(literal_one_byte_string().start()); | 444 reinterpret_cast<const char*>(literal_one_byte_string().start()); |
| 444 return !strncmp(token, data, length); | 445 return !strncmp(token, data, length); |
| 445 } | 446 } |
| 446 return false; | 447 return false; |
| 447 } | 448 } |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 bool has_multiline_comment_before_next_; | 799 bool has_multiline_comment_before_next_; |
| 799 // Whether we scan 'module', 'import', 'export' as keywords. | 800 // Whether we scan 'module', 'import', 'export' as keywords. |
| 800 bool harmony_modules_; | 801 bool harmony_modules_; |
| 801 // Whether we allow \u{xxxxx}. | 802 // Whether we allow \u{xxxxx}. |
| 802 bool harmony_unicode_; | 803 bool harmony_unicode_; |
| 803 }; | 804 }; |
| 804 | 805 |
| 805 } } // namespace v8::internal | 806 } } // namespace v8::internal |
| 806 | 807 |
| 807 #endif // V8_SCANNER_H_ | 808 #endif // V8_SCANNER_H_ |
| OLD | NEW |