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/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/hashmap.h" | 10 #include "src/hashmap.h" |
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 | 1023 |
1024 // All ParseXXX functions take as the last argument an *ok parameter | 1024 // All ParseXXX functions take as the last argument an *ok parameter |
1025 // which is set to false if parsing failed; it is unchanged otherwise. | 1025 // which is set to false if parsing failed; it is unchanged otherwise. |
1026 // By making the 'exception handling' explicit, we are forced to check | 1026 // By making the 'exception handling' explicit, we are forced to check |
1027 // for failure at the call sites. | 1027 // for failure at the call sites. |
1028 Statement ParseStatementListItem(bool* ok); | 1028 Statement ParseStatementListItem(bool* ok); |
1029 void ParseStatementList(int end_token, bool* ok, | 1029 void ParseStatementList(int end_token, bool* ok, |
1030 Scanner::BookmarkScope* bookmark = nullptr); | 1030 Scanner::BookmarkScope* bookmark = nullptr); |
1031 Statement ParseStatement(bool* ok); | 1031 Statement ParseStatement(bool* ok); |
1032 Statement ParseSubStatement(bool* ok); | 1032 Statement ParseSubStatement(bool* ok); |
| 1033 Statement ParseScopedStatement(bool legacy, bool* ok); |
1033 Statement ParseFunctionDeclaration(bool* ok); | 1034 Statement ParseFunctionDeclaration(bool* ok); |
1034 Statement ParseClassDeclaration(bool* ok); | 1035 Statement ParseClassDeclaration(bool* ok); |
1035 Statement ParseBlock(bool* ok); | 1036 Statement ParseBlock(bool* ok); |
1036 Statement ParseVariableStatement(VariableDeclarationContext var_context, | 1037 Statement ParseVariableStatement(VariableDeclarationContext var_context, |
1037 bool* ok); | 1038 bool* ok); |
1038 Statement ParseVariableDeclarations(VariableDeclarationContext var_context, | 1039 Statement ParseVariableDeclarations(VariableDeclarationContext var_context, |
1039 int* num_decl, bool* is_lexical, | 1040 int* num_decl, bool* is_lexical, |
1040 bool* is_binding_pattern, | 1041 bool* is_binding_pattern, |
1041 Scanner::Location* first_initializer_loc, | 1042 Scanner::Location* first_initializer_loc, |
1042 Scanner::Location* bindings_loc, | 1043 Scanner::Location* bindings_loc, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 const PreParserFormalParameters& parameters, FunctionKind kind, | 1169 const PreParserFormalParameters& parameters, FunctionKind kind, |
1169 FunctionLiteral::FunctionType function_type, bool* ok) { | 1170 FunctionLiteral::FunctionType function_type, bool* ok) { |
1170 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, | 1171 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, |
1171 kind, function_type, ok); | 1172 kind, function_type, ok); |
1172 } | 1173 } |
1173 | 1174 |
1174 } // namespace internal | 1175 } // namespace internal |
1175 } // namespace v8 | 1176 } // namespace v8 |
1176 | 1177 |
1177 #endif // V8_PARSING_PREPARSER_H | 1178 #endif // V8_PARSING_PREPARSER_H |
OLD | NEW |