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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 Statement PreParser<Scanner, Log>::ParseThrowStatement(bool* ok) { | 713 Statement PreParser<Scanner, Log>::ParseThrowStatement(bool* ok) { |
714 // ThrowStatement :: | 714 // ThrowStatement :: |
715 // 'throw' [no line terminator] Expression ';' | 715 // 'throw' [no line terminator] Expression ';' |
716 | 716 |
717 Expect(i::Token::THROW, CHECK_OK); | 717 Expect(i::Token::THROW, CHECK_OK); |
718 if (scanner_->has_line_terminator_before_next()) { | 718 if (scanner_->has_line_terminator_before_next()) { |
719 typename Scanner::Location pos = scanner_->location(); | 719 typename Scanner::Location pos = scanner_->location(); |
720 ReportMessageAt(pos.beg_pos, pos.end_pos, | 720 ReportMessageAt(pos.beg_pos, pos.end_pos, |
721 "newline_after_throw", NULL); | 721 "newline_after_throw", NULL); |
722 *ok = false; | 722 *ok = false; |
723 return NULL; | 723 return kUnknownStatement; |
724 } | 724 } |
725 ParseExpression(true, CHECK_OK); | 725 ParseExpression(true, CHECK_OK); |
726 ExpectSemicolon(CHECK_OK); | 726 ExpectSemicolon(CHECK_OK); |
727 | 727 |
728 return kUnknownStatement; | 728 return kUnknownStatement; |
729 } | 729 } |
730 | 730 |
731 | 731 |
732 template <typename Scanner, typename Log> | 732 template <typename Scanner, typename Log> |
733 Statement PreParser<Scanner, Log>::ParseTryStatement(bool* ok) { | 733 Statement PreParser<Scanner, Log>::ParseTryStatement(bool* ok) { |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 | 999 |
1000 | 1000 |
1001 template <typename Scanner, typename Log> | 1001 template <typename Scanner, typename Log> |
1002 Expression PreParser<Scanner, Log>::ParseMemberWithNewPrefixesExpression( | 1002 Expression PreParser<Scanner, Log>::ParseMemberWithNewPrefixesExpression( |
1003 unsigned new_count, bool* ok) { | 1003 unsigned new_count, bool* ok) { |
1004 // MemberExpression :: | 1004 // MemberExpression :: |
1005 // (PrimaryExpression | FunctionLiteral) | 1005 // (PrimaryExpression | FunctionLiteral) |
1006 // ('[' Expression ']' | '.' Identifier | Arguments)* | 1006 // ('[' Expression ']' | '.' Identifier | Arguments)* |
1007 | 1007 |
1008 // Parse the initial primary or function expression. | 1008 // Parse the initial primary or function expression. |
1009 Expression result = NULL; | 1009 Expression result = kUnknownExpression; |
1010 if (peek() == i::Token::FUNCTION) { | 1010 if (peek() == i::Token::FUNCTION) { |
1011 Consume(i::Token::FUNCTION); | 1011 Consume(i::Token::FUNCTION); |
1012 if (peek() == i::Token::IDENTIFIER) { | 1012 if (peek() == i::Token::IDENTIFIER) { |
1013 ParseIdentifier(CHECK_OK); | 1013 ParseIdentifier(CHECK_OK); |
1014 } | 1014 } |
1015 result = ParseFunctionLiteral(CHECK_OK); | 1015 result = ParseFunctionLiteral(CHECK_OK); |
1016 } else { | 1016 } else { |
1017 result = ParsePrimaryExpression(CHECK_OK); | 1017 result = ParsePrimaryExpression(CHECK_OK); |
1018 } | 1018 } |
1019 | 1019 |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 *is_get = strncmp(token, "get", 3) == 0; | 1410 *is_get = strncmp(token, "get", 3) == 0; |
1411 *is_set = !*is_get && strncmp(token, "set", 3) == 0; | 1411 *is_set = !*is_get && strncmp(token, "set", 3) == 0; |
1412 } | 1412 } |
1413 return GetIdentifierSymbol(); | 1413 return GetIdentifierSymbol(); |
1414 } | 1414 } |
1415 | 1415 |
1416 #undef CHECK_OK | 1416 #undef CHECK_OK |
1417 } } // v8::preparser | 1417 } } // v8::preparser |
1418 | 1418 |
1419 #endif // V8_PREPARSER_H | 1419 #endif // V8_PREPARSER_H |
OLD | NEW |