| 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 IsFloat(); |
| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 bool harmony_modules_; | 806 bool harmony_modules_; |
| 806 // Whether we scan 'class', 'extends', 'static' and 'super' as keywords. | 807 // Whether we scan 'class', 'extends', 'static' and 'super' as keywords. |
| 807 bool harmony_classes_; | 808 bool harmony_classes_; |
| 808 // Whether we allow \u{xxxxx}. | 809 // Whether we allow \u{xxxxx}. |
| 809 bool harmony_unicode_; | 810 bool harmony_unicode_; |
| 810 }; | 811 }; |
| 811 | 812 |
| 812 } } // namespace v8::internal | 813 } } // namespace v8::internal |
| 813 | 814 |
| 814 #endif // V8_SCANNER_H_ | 815 #endif // V8_SCANNER_H_ |
| OLD | NEW |