OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 int literal_position = scanner_->location().beg_pos; | 1363 int literal_position = scanner_->location().beg_pos; |
1364 log_->LogSymbol(literal_position, literal_chars, literal_length); | 1364 log_->LogSymbol(literal_position, literal_chars, literal_length); |
1365 | 1365 |
1366 return kUnknownExpression; | 1366 return kUnknownExpression; |
1367 } | 1367 } |
1368 | 1368 |
1369 | 1369 |
1370 template <typename Scanner, typename Log> | 1370 template <typename Scanner, typename Log> |
1371 Identifier PreParser<Scanner, Log>::ParseIdentifier(bool* ok) { | 1371 Identifier PreParser<Scanner, Log>::ParseIdentifier(bool* ok) { |
1372 Expect(i::Token::IDENTIFIER, ok); | 1372 Expect(i::Token::IDENTIFIER, ok); |
| 1373 if (!*ok) return kUnknownIdentifier; |
1373 return GetIdentifierSymbol(); | 1374 return GetIdentifierSymbol(); |
1374 } | 1375 } |
1375 | 1376 |
1376 | 1377 |
1377 template <typename Scanner, typename Log> | 1378 template <typename Scanner, typename Log> |
1378 Identifier PreParser<Scanner, Log>::ParseIdentifierName(bool* ok) { | 1379 Identifier PreParser<Scanner, Log>::ParseIdentifierName(bool* ok) { |
1379 i::Token::Value next = Next(); | 1380 i::Token::Value next = Next(); |
1380 if (i::Token::IsKeyword(next)) { | 1381 if (i::Token::IsKeyword(next)) { |
1381 int pos = scanner_->location().beg_pos; | 1382 int pos = scanner_->location().beg_pos; |
1382 const char* keyword = i::Token::String(next); | 1383 const char* keyword = i::Token::String(next); |
(...skipping 22 matching lines...) Expand all Loading... |
1405 *is_get = strncmp(token, "get", 3) == 0; | 1406 *is_get = strncmp(token, "get", 3) == 0; |
1406 *is_set = !*is_get && strncmp(token, "set", 3) == 0; | 1407 *is_set = !*is_get && strncmp(token, "set", 3) == 0; |
1407 } | 1408 } |
1408 return GetIdentifierSymbol(); | 1409 return GetIdentifierSymbol(); |
1409 } | 1410 } |
1410 | 1411 |
1411 #undef CHECK_OK | 1412 #undef CHECK_OK |
1412 } } // v8::preparser | 1413 } } // v8::preparser |
1413 | 1414 |
1414 #endif // V8_PREPARSER_H | 1415 #endif // V8_PREPARSER_H |
OLD | NEW |