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

Side by Side Diff: src/scanner.cc

Issue 918203002: Get rid of PreParserIdentifier. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: . Created 5 years, 10 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') | no next file » | 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 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 (keyword_length <= 9 || input[9] == keyword[9])) { \ 1151 (keyword_length <= 9 || input[9] == keyword[9])) { \
1152 return token; \ 1152 return token; \
1153 } \ 1153 } \
1154 } 1154 }
1155 KEYWORDS(KEYWORD_GROUP_CASE, KEYWORD) 1155 KEYWORDS(KEYWORD_GROUP_CASE, KEYWORD)
1156 } 1156 }
1157 return Token::IDENTIFIER; 1157 return Token::IDENTIFIER;
1158 } 1158 }
1159 1159
1160 1160
1161 bool Scanner::IdentifierIsFutureReserved(const AstRawString* string) const {
1162 return Token::FUTURE_RESERVED_WORD ==
1163 KeywordOrIdentifierToken(string->raw_data(), string->length(),
1164 harmony_scoping_, harmony_modules_,
1165 harmony_classes_);
1166 }
1167
1168
1161 bool Scanner::IdentifierIsFutureStrictReserved( 1169 bool Scanner::IdentifierIsFutureStrictReserved(
1162 const AstRawString* string) const { 1170 const AstRawString* string) const {
1163 // Keywords are always 1-byte strings. 1171 // Keywords are always 1-byte strings.
1164 if (!string->is_one_byte()) return false; 1172 if (!string->is_one_byte()) return false;
1165 if (string->IsOneByteEqualTo("let") || string->IsOneByteEqualTo("static") || 1173 if (string->IsOneByteEqualTo("let") || string->IsOneByteEqualTo("static") ||
1166 string->IsOneByteEqualTo("yield")) { 1174 string->IsOneByteEqualTo("yield")) {
1167 return true; 1175 return true;
1168 } 1176 }
1169 return Token::FUTURE_STRICT_RESERVED_WORD == 1177 return Token::FUTURE_STRICT_RESERVED_WORD ==
1170 KeywordOrIdentifierToken(string->raw_data(), string->length(), 1178 KeywordOrIdentifierToken(string->raw_data(), string->length(),
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 } 1495 }
1488 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); 1496 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u));
1489 } 1497 }
1490 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); 1498 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f));
1491 1499
1492 backing_store_.AddBlock(bytes); 1500 backing_store_.AddBlock(bytes);
1493 return backing_store_.EndSequence().start(); 1501 return backing_store_.EndSequence().start();
1494 } 1502 }
1495 1503
1496 } } // namespace v8::internal 1504 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/scanner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698