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

Side by Side Diff: src/scanner.cc

Issue 1027593005: [es6] remove --harmony-templates flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove extra references to harmony-templates stuff Created 5 years, 9 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/scanner.h ('k') | src/string.js » ('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 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 20 matching lines...) Expand all
31 31
32 // ---------------------------------------------------------------------------- 32 // ----------------------------------------------------------------------------
33 // Scanner 33 // Scanner
34 34
35 Scanner::Scanner(UnicodeCache* unicode_cache) 35 Scanner::Scanner(UnicodeCache* unicode_cache)
36 : unicode_cache_(unicode_cache), 36 : unicode_cache_(unicode_cache),
37 octal_pos_(Location::invalid()), 37 octal_pos_(Location::invalid()),
38 harmony_modules_(false), 38 harmony_modules_(false),
39 harmony_numeric_literals_(false), 39 harmony_numeric_literals_(false),
40 harmony_classes_(false), 40 harmony_classes_(false),
41 harmony_templates_(false),
42 harmony_unicode_(false) {} 41 harmony_unicode_(false) {}
43 42
44 43
45 void Scanner::Initialize(Utf16CharacterStream* source) { 44 void Scanner::Initialize(Utf16CharacterStream* source) {
46 source_ = source; 45 source_ = source;
47 // Need to capture identifiers in order to recognize "get" and "set" 46 // Need to capture identifiers in order to recognize "get" and "set"
48 // in object literals. 47 // in object literals.
49 Init(); 48 Init();
50 // Skip initial whitespace allowing HTML comment ends just like 49 // Skip initial whitespace allowing HTML comment ends just like
51 // after a newline and scan first token. 50 // after a newline and scan first token.
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 647
649 case '?': 648 case '?':
650 token = Select(Token::CONDITIONAL); 649 token = Select(Token::CONDITIONAL);
651 break; 650 break;
652 651
653 case '~': 652 case '~':
654 token = Select(Token::BIT_NOT); 653 token = Select(Token::BIT_NOT);
655 break; 654 break;
656 655
657 case '`': 656 case '`':
658 if (HarmonyTemplates()) { 657 token = ScanTemplateStart();
659 token = ScanTemplateStart(); 658 break;
660 break;
661 }
662 659
663 default: 660 default:
664 if (c0_ < 0) { 661 if (c0_ < 0) {
665 token = Token::EOS; 662 token = Token::EOS;
666 } else if (unicode_cache_->IsIdentifierStart(c0_)) { 663 } else if (unicode_cache_->IsIdentifierStart(c0_)) {
667 token = ScanIdentifierOrKeyword(); 664 token = ScanIdentifierOrKeyword();
668 } else if (IsDecimalDigit(c0_)) { 665 } else if (IsDecimalDigit(c0_)) {
669 token = ScanNumber(false); 666 token = ScanNumber(false);
670 } else if (SkipWhiteSpace()) { 667 } else if (SkipWhiteSpace()) {
671 token = Token::WHITESPACE; 668 token = Token::WHITESPACE;
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 } 1560 }
1564 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); 1561 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u));
1565 } 1562 }
1566 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); 1563 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f));
1567 1564
1568 backing_store_.AddBlock(bytes); 1565 backing_store_.AddBlock(bytes);
1569 return backing_store_.EndSequence().start(); 1566 return backing_store_.EndSequence().start();
1570 } 1567 }
1571 1568
1572 } } // namespace v8::internal 1569 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/scanner.h ('k') | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698