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

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: fix Created 5 years, 5 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') | no next file with comments »
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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698