Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: src/scanner.h

Issue 1201783003: Allow numeric literals to be checked for a decimal point. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/parser.cc ('k') | src/scanner.cc » ('j') | src/scanner.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/scanner.cc » ('j') | src/scanner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698