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 #include "src/parsing/scanner.h" | 7 #include "src/parsing/scanner.h" |
8 | 8 |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 if (input_length == keyword_length && input[1] == keyword[1] && \ | 1199 if (input_length == keyword_length && input[1] == keyword[1] && \ |
1200 (keyword_length <= 2 || input[2] == keyword[2]) && \ | 1200 (keyword_length <= 2 || input[2] == keyword[2]) && \ |
1201 (keyword_length <= 3 || input[3] == keyword[3]) && \ | 1201 (keyword_length <= 3 || input[3] == keyword[3]) && \ |
1202 (keyword_length <= 4 || input[4] == keyword[4]) && \ | 1202 (keyword_length <= 4 || input[4] == keyword[4]) && \ |
1203 (keyword_length <= 5 || input[5] == keyword[5]) && \ | 1203 (keyword_length <= 5 || input[5] == keyword[5]) && \ |
1204 (keyword_length <= 6 || input[6] == keyword[6]) && \ | 1204 (keyword_length <= 6 || input[6] == keyword[6]) && \ |
1205 (keyword_length <= 7 || input[7] == keyword[7]) && \ | 1205 (keyword_length <= 7 || input[7] == keyword[7]) && \ |
1206 (keyword_length <= 8 || input[8] == keyword[8]) && \ | 1206 (keyword_length <= 8 || input[8] == keyword[8]) && \ |
1207 (keyword_length <= 9 || input[9] == keyword[9])) { \ | 1207 (keyword_length <= 9 || input[9] == keyword[9])) { \ |
1208 if (escaped) { \ | 1208 if (escaped) { \ |
1209 return token == Token::FUTURE_STRICT_RESERVED_WORD \ | 1209 /* TODO(adamk): YIELD should be handled specially. */ \ |
| 1210 return (token == Token::FUTURE_STRICT_RESERVED_WORD || \ |
| 1211 token == Token::LET || token == Token::STATIC) \ |
1210 ? Token::ESCAPED_STRICT_RESERVED_WORD \ | 1212 ? Token::ESCAPED_STRICT_RESERVED_WORD \ |
1211 : Token::ESCAPED_KEYWORD; \ | 1213 : Token::ESCAPED_KEYWORD; \ |
1212 } \ | 1214 } \ |
1213 return token; \ | 1215 return token; \ |
1214 } \ | 1216 } \ |
1215 } | 1217 } |
1216 KEYWORDS(KEYWORD_GROUP_CASE, KEYWORD) | 1218 KEYWORDS(KEYWORD_GROUP_CASE, KEYWORD) |
1217 } | 1219 } |
1218 return Token::IDENTIFIER; | 1220 return Token::IDENTIFIER; |
1219 } | 1221 } |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1664 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); | 1666 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); |
1665 } | 1667 } |
1666 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); | 1668 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); |
1667 | 1669 |
1668 backing_store_.AddBlock(bytes); | 1670 backing_store_.AddBlock(bytes); |
1669 return backing_store_.EndSequence().start(); | 1671 return backing_store_.EndSequence().start(); |
1670 } | 1672 } |
1671 | 1673 |
1672 } // namespace internal | 1674 } // namespace internal |
1673 } // namespace v8 | 1675 } // namespace v8 |
OLD | NEW |