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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 if (is_literal_one_byte() && | 420 if (is_literal_one_byte() && |
421 literal_length() == 3 && | 421 literal_length() == 3 && |
422 !literal_contains_escapes()) { | 422 !literal_contains_escapes()) { |
423 const char* token = | 423 const char* token = |
424 reinterpret_cast<const char*>(literal_one_byte_string().start()); | 424 reinterpret_cast<const char*>(literal_one_byte_string().start()); |
425 *is_get = strncmp(token, "get", 3) == 0; | 425 *is_get = strncmp(token, "get", 3) == 0; |
426 *is_set = !*is_get && strncmp(token, "set", 3) == 0; | 426 *is_set = !*is_get && strncmp(token, "set", 3) == 0; |
427 } | 427 } |
428 } | 428 } |
429 | 429 |
430 int FindNumber(DuplicateFinder* finder, int value); | |
431 int FindSymbol(DuplicateFinder* finder, int value); | 430 int FindSymbol(DuplicateFinder* finder, int value); |
432 | 431 |
433 UnicodeCache* unicode_cache() { return unicode_cache_; } | 432 UnicodeCache* unicode_cache() { return unicode_cache_; } |
434 | 433 |
435 // Returns the location of the last seen octal literal. | 434 // Returns the location of the last seen octal literal. |
436 Location octal_position() const { return octal_pos_; } | 435 Location octal_position() const { return octal_pos_; } |
437 void clear_octal_position() { octal_pos_ = Location::invalid(); } | 436 void clear_octal_position() { octal_pos_ = Location::invalid(); } |
438 | 437 |
439 // Returns the value of the last smi that was scanned. | 438 // Returns the value of the last smi that was scanned. |
440 int smi_value() const { return smi_value_; } | 439 int smi_value() const { return smi_value_; } |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 bool harmony_classes_; | 751 bool harmony_classes_; |
753 // Whether we scan TEMPLATE_SPAN and TEMPLATE_TAIL | 752 // Whether we scan TEMPLATE_SPAN and TEMPLATE_TAIL |
754 bool harmony_templates_; | 753 bool harmony_templates_; |
755 // Whether we allow \u{xxxxx}. | 754 // Whether we allow \u{xxxxx}. |
756 bool harmony_unicode_; | 755 bool harmony_unicode_; |
757 }; | 756 }; |
758 | 757 |
759 } } // namespace v8::internal | 758 } } // namespace v8::internal |
760 | 759 |
761 #endif // V8_SCANNER_H_ | 760 #endif // V8_SCANNER_H_ |
OLD | NEW |