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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 // are either being counted in the preparser data, or is important | 1012 // are either being counted in the preparser data, or is important |
1013 // to throw the correct syntax error exceptions. | 1013 // to throw the correct syntax error exceptions. |
1014 | 1014 |
1015 // All ParseXXX functions take as the last argument an *ok parameter | 1015 // All ParseXXX functions take as the last argument an *ok parameter |
1016 // which is set to false if parsing failed; it is unchanged otherwise. | 1016 // which is set to false if parsing failed; it is unchanged otherwise. |
1017 // By making the 'exception handling' explicit, we are forced to check | 1017 // By making the 'exception handling' explicit, we are forced to check |
1018 // for failure at the call sites. | 1018 // for failure at the call sites. |
1019 Statement ParseStatementListItem(bool* ok); | 1019 Statement ParseStatementListItem(bool* ok); |
1020 void ParseStatementList(int end_token, bool* ok, | 1020 void ParseStatementList(int end_token, bool* ok, |
1021 Scanner::BookmarkScope* bookmark = nullptr); | 1021 Scanner::BookmarkScope* bookmark = nullptr); |
1022 Statement ParseStatement(bool* ok); | 1022 Statement ParseStatement(AllowLabelledFunctionStatement allow_function, |
1023 Statement ParseSubStatement(bool* ok); | 1023 bool* ok); |
| 1024 Statement ParseSubStatement(AllowLabelledFunctionStatement allow_function, |
| 1025 bool* ok); |
1024 Statement ParseScopedStatement(bool legacy, bool* ok); | 1026 Statement ParseScopedStatement(bool legacy, bool* ok); |
1025 Statement ParseFunctionDeclaration(bool* ok); | 1027 Statement ParseFunctionDeclaration(bool* ok); |
1026 Statement ParseClassDeclaration(bool* ok); | 1028 Statement ParseClassDeclaration(bool* ok); |
1027 Statement ParseBlock(bool* ok); | 1029 Statement ParseBlock(bool* ok); |
1028 Statement ParseVariableStatement(VariableDeclarationContext var_context, | 1030 Statement ParseVariableStatement(VariableDeclarationContext var_context, |
1029 bool* ok); | 1031 bool* ok); |
1030 Statement ParseVariableDeclarations(VariableDeclarationContext var_context, | 1032 Statement ParseVariableDeclarations(VariableDeclarationContext var_context, |
1031 int* num_decl, bool* is_lexical, | 1033 int* num_decl, bool* is_lexical, |
1032 bool* is_binding_pattern, | 1034 bool* is_binding_pattern, |
1033 Scanner::Location* first_initializer_loc, | 1035 Scanner::Location* first_initializer_loc, |
1034 Scanner::Location* bindings_loc, | 1036 Scanner::Location* bindings_loc, |
1035 bool* ok); | 1037 bool* ok); |
1036 Statement ParseExpressionOrLabelledStatement(bool* ok); | 1038 Statement ParseExpressionOrLabelledStatement( |
| 1039 AllowLabelledFunctionStatement allow_function, bool* ok); |
1037 Statement ParseIfStatement(bool* ok); | 1040 Statement ParseIfStatement(bool* ok); |
1038 Statement ParseContinueStatement(bool* ok); | 1041 Statement ParseContinueStatement(bool* ok); |
1039 Statement ParseBreakStatement(bool* ok); | 1042 Statement ParseBreakStatement(bool* ok); |
1040 Statement ParseReturnStatement(bool* ok); | 1043 Statement ParseReturnStatement(bool* ok); |
1041 Statement ParseWithStatement(bool* ok); | 1044 Statement ParseWithStatement(bool* ok); |
1042 Statement ParseSwitchStatement(bool* ok); | 1045 Statement ParseSwitchStatement(bool* ok); |
1043 Statement ParseDoWhileStatement(bool* ok); | 1046 Statement ParseDoWhileStatement(bool* ok); |
1044 Statement ParseWhileStatement(bool* ok); | 1047 Statement ParseWhileStatement(bool* ok); |
1045 Statement ParseForStatement(bool* ok); | 1048 Statement ParseForStatement(bool* ok); |
1046 Statement ParseThrowStatement(bool* ok); | 1049 Statement ParseThrowStatement(bool* ok); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 const PreParserFormalParameters& parameters, FunctionKind kind, | 1162 const PreParserFormalParameters& parameters, FunctionKind kind, |
1160 FunctionLiteral::FunctionType function_type, bool* ok) { | 1163 FunctionLiteral::FunctionType function_type, bool* ok) { |
1161 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, | 1164 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, |
1162 kind, function_type, ok); | 1165 kind, function_type, ok); |
1163 } | 1166 } |
1164 | 1167 |
1165 } // namespace internal | 1168 } // namespace internal |
1166 } // namespace v8 | 1169 } // namespace v8 |
1167 | 1170 |
1168 #endif // V8_PARSING_PREPARSER_H | 1171 #endif // V8_PARSING_PREPARSER_H |
OLD | NEW |