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_PREPARSER_H | 5 #ifndef V8_PARSING_PREPARSER_H |
6 #define V8_PARSING_PREPARSER_H | 6 #define V8_PARSING_PREPARSER_H |
7 | 7 |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/parsing/parser-base.h" | 9 #include "src/parsing/parser-base.h" |
10 | 10 |
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 int start_position = scanner()->peek_location().beg_pos; | 866 int start_position = scanner()->peek_location().beg_pos; |
867 parsing_module_ = is_module; | 867 parsing_module_ = is_module; |
868 PreParserStatementList body; | 868 PreParserStatementList body; |
869 ParseStatementList(body, Token::EOS, &ok); | 869 ParseStatementList(body, Token::EOS, &ok); |
870 if (stack_overflow()) return kPreParseStackOverflow; | 870 if (stack_overflow()) return kPreParseStackOverflow; |
871 if (!ok) { | 871 if (!ok) { |
872 ReportUnexpectedToken(scanner()->current_token()); | 872 ReportUnexpectedToken(scanner()->current_token()); |
873 } else if (is_strict(this->scope()->language_mode())) { | 873 } else if (is_strict(this->scope()->language_mode())) { |
874 CheckStrictOctalLiteral(start_position, scanner()->location().end_pos, | 874 CheckStrictOctalLiteral(start_position, scanner()->location().end_pos, |
875 &ok); | 875 &ok); |
876 CheckDecimalLiteralWithLeadingZero(start_position, | |
877 scanner()->location().end_pos); | |
878 } | 876 } |
879 if (materialized_literals) { | 877 if (materialized_literals) { |
880 *materialized_literals = function_state_->materialized_literal_count(); | 878 *materialized_literals = function_state_->materialized_literal_count(); |
881 } | 879 } |
882 return kPreParseSuccess; | 880 return kPreParseSuccess; |
883 } | 881 } |
884 | 882 |
885 // Parses a single function literal, from the opening parentheses before | 883 // Parses a single function literal, from the opening parentheses before |
886 // parameters to the closing brace after the body. | 884 // parameters to the closing brace after the body. |
887 // Returns a FunctionEntry describing the body of the function in enough | 885 // Returns a FunctionEntry describing the body of the function in enough |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 function_state_->NextMaterializedLiteralIndex(); | 1549 function_state_->NextMaterializedLiteralIndex(); |
1552 function_state_->NextMaterializedLiteralIndex(); | 1550 function_state_->NextMaterializedLiteralIndex(); |
1553 } | 1551 } |
1554 return EmptyExpression(); | 1552 return EmptyExpression(); |
1555 } | 1553 } |
1556 | 1554 |
1557 } // namespace internal | 1555 } // namespace internal |
1558 } // namespace v8 | 1556 } // namespace v8 |
1559 | 1557 |
1560 #endif // V8_PARSING_PREPARSER_H | 1558 #endif // V8_PARSING_PREPARSER_H |
OLD | NEW |