OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_PARSING_PARSER_BASE_H | 5 #ifndef V8_PARSING_PARSER_BASE_H |
6 #define V8_PARSING_PARSER_BASE_H | 6 #define V8_PARSING_PARSER_BASE_H |
7 | 7 |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/hashmap.h" | 10 #include "src/hashmap.h" |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 *visit_mode = ForEachStatement::ENUMERATE; | 454 *visit_mode = ForEachStatement::ENUMERATE; |
455 } | 455 } |
456 return true; | 456 return true; |
457 } else if (CheckContextualKeyword(CStrVector("of"))) { | 457 } else if (CheckContextualKeyword(CStrVector("of"))) { |
458 *visit_mode = ForEachStatement::ITERATE; | 458 *visit_mode = ForEachStatement::ITERATE; |
459 return true; | 459 return true; |
460 } | 460 } |
461 return false; | 461 return false; |
462 } | 462 } |
463 | 463 |
| 464 bool PeekInOrOf() { |
| 465 return peek() == Token::IN || PeekContextualKeyword(CStrVector("of")); |
| 466 } |
| 467 |
464 // Checks whether an octal literal was last seen between beg_pos and end_pos. | 468 // Checks whether an octal literal was last seen between beg_pos and end_pos. |
465 // If so, reports an error. Only called for strict mode and template strings. | 469 // If so, reports an error. Only called for strict mode and template strings. |
466 void CheckOctalLiteral(int beg_pos, int end_pos, | 470 void CheckOctalLiteral(int beg_pos, int end_pos, |
467 MessageTemplate::Template message, bool* ok) { | 471 MessageTemplate::Template message, bool* ok) { |
468 Scanner::Location octal = scanner()->octal_position(); | 472 Scanner::Location octal = scanner()->octal_position(); |
469 if (octal.IsValid() && beg_pos <= octal.beg_pos && | 473 if (octal.IsValid() && beg_pos <= octal.beg_pos && |
470 octal.end_pos <= end_pos) { | 474 octal.end_pos <= end_pos) { |
471 ReportMessageAt(octal, message); | 475 ReportMessageAt(octal, message); |
472 scanner()->clear_octal_position(); | 476 scanner()->clear_octal_position(); |
473 *ok = false; | 477 *ok = false; |
(...skipping 2904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3378 return; | 3382 return; |
3379 } | 3383 } |
3380 has_seen_constructor_ = true; | 3384 has_seen_constructor_ = true; |
3381 return; | 3385 return; |
3382 } | 3386 } |
3383 } | 3387 } |
3384 } // namespace internal | 3388 } // namespace internal |
3385 } // namespace v8 | 3389 } // namespace v8 |
3386 | 3390 |
3387 #endif // V8_PARSING_PARSER_BASE_H | 3391 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |