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 #include <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "include/v8stdint.h" | 7 #include "include/v8stdint.h" |
8 | 8 |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/base/logging.h" | 10 #include "src/base/logging.h" |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 Expect(Token::LPAREN, CHECK_OK); | 646 Expect(Token::LPAREN, CHECK_OK); |
647 ParseExpression(true, CHECK_OK); | 647 ParseExpression(true, CHECK_OK); |
648 Expect(Token::RPAREN, CHECK_OK); | 648 Expect(Token::RPAREN, CHECK_OK); |
649 ParseStatement(ok); | 649 ParseStatement(ok); |
650 return Statement::Default(); | 650 return Statement::Default(); |
651 } | 651 } |
652 | 652 |
653 | 653 |
654 bool PreParser::CheckInOrOf(bool accept_OF) { | 654 bool PreParser::CheckInOrOf(bool accept_OF) { |
655 if (Check(Token::IN) || | 655 if (Check(Token::IN) || |
656 (allow_for_of() && accept_OF && | 656 (accept_OF && CheckContextualKeyword(CStrVector("of")))) { |
657 CheckContextualKeyword(CStrVector("of")))) { | |
658 return true; | 657 return true; |
659 } | 658 } |
660 return false; | 659 return false; |
661 } | 660 } |
662 | 661 |
663 | 662 |
664 PreParser::Statement PreParser::ParseForStatement(bool* ok) { | 663 PreParser::Statement PreParser::ParseForStatement(bool* ok) { |
665 // ForStatement :: | 664 // ForStatement :: |
666 // 'for' '(' Expression? ';' Expression? ';' Expression? ')' Statement | 665 // 'for' '(' Expression? ';' Expression? ';' Expression? ')' Statement |
667 | 666 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); | 927 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); |
929 ParseArguments(ok); | 928 ParseArguments(ok); |
930 | 929 |
931 return Expression::Default(); | 930 return Expression::Default(); |
932 } | 931 } |
933 | 932 |
934 #undef CHECK_OK | 933 #undef CHECK_OK |
935 | 934 |
936 | 935 |
937 } } // v8::internal | 936 } } // v8::internal |
OLD | NEW |