| 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_PARSER_H_ | 5 #ifndef V8_PARSER_H_ |
| 6 #define V8_PARSER_H_ | 6 #define V8_PARSER_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/compiler.h" // TODO(titzer): remove this include dependency | 10 #include "src/compiler.h" // TODO(titzer): remove this include dependency |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 ParserFormalParameterParsingState* scope, Expression* params, | 787 ParserFormalParameterParsingState* scope, Expression* params, |
| 788 const Scanner::Location& params_loc, Scanner::Location* duplicate_loc, | 788 const Scanner::Location& params_loc, Scanner::Location* duplicate_loc, |
| 789 bool* ok); | 789 bool* ok); |
| 790 | 790 |
| 791 void ReindexLiterals(const ParserFormalParameterParsingState& parsing_state); | 791 void ReindexLiterals(const ParserFormalParameterParsingState& parsing_state); |
| 792 | 792 |
| 793 // Temporary glue; these functions will move to ParserBase. | 793 // Temporary glue; these functions will move to ParserBase. |
| 794 Expression* ParseV8Intrinsic(bool* ok); | 794 Expression* ParseV8Intrinsic(bool* ok); |
| 795 FunctionLiteral* ParseFunctionLiteral( | 795 FunctionLiteral* ParseFunctionLiteral( |
| 796 const AstRawString* name, Scanner::Location function_name_location, | 796 const AstRawString* name, Scanner::Location function_name_location, |
| 797 bool name_is_strict_reserved, FunctionKind kind, | 797 FunctionNameValidity function_name_validity, FunctionKind kind, |
| 798 int function_token_position, FunctionLiteral::FunctionType type, | 798 int function_token_position, FunctionLiteral::FunctionType type, |
| 799 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); | 799 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); |
| 800 V8_INLINE void SkipLazyFunctionBody( | 800 V8_INLINE void SkipLazyFunctionBody( |
| 801 int* materialized_literal_count, int* expected_property_count, bool* ok, | 801 int* materialized_literal_count, int* expected_property_count, bool* ok, |
| 802 Scanner::BookmarkScope* bookmark = nullptr); | 802 Scanner::BookmarkScope* bookmark = nullptr); |
| 803 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody( | 803 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody( |
| 804 const AstRawString* name, int pos, | 804 const AstRawString* name, int pos, |
| 805 const ParserFormalParameterParsingState& formal_parameters, | 805 const ParserFormalParameterParsingState& formal_parameters, |
| 806 Variable* fvar, Token::Value fvar_init_op, FunctionKind kind, bool* ok); | 806 Variable* fvar, Token::Value fvar_init_op, FunctionKind kind, bool* ok); |
| 807 | 807 |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 Expression* each, | 1089 Expression* each, |
| 1090 Expression* subject, | 1090 Expression* subject, |
| 1091 Statement* body); | 1091 Statement* body); |
| 1092 Statement* DesugarLexicalBindingsInForStatement( | 1092 Statement* DesugarLexicalBindingsInForStatement( |
| 1093 Scope* inner_scope, bool is_const, ZoneList<const AstRawString*>* names, | 1093 Scope* inner_scope, bool is_const, ZoneList<const AstRawString*>* names, |
| 1094 ForStatement* loop, Statement* init, Expression* cond, Statement* next, | 1094 ForStatement* loop, Statement* init, Expression* cond, Statement* next, |
| 1095 Statement* body, bool* ok); | 1095 Statement* body, bool* ok); |
| 1096 | 1096 |
| 1097 FunctionLiteral* ParseFunctionLiteral( | 1097 FunctionLiteral* ParseFunctionLiteral( |
| 1098 const AstRawString* name, Scanner::Location function_name_location, | 1098 const AstRawString* name, Scanner::Location function_name_location, |
| 1099 bool name_is_strict_reserved, FunctionKind kind, | 1099 FunctionNameValidity function_name_validity, FunctionKind kind, |
| 1100 int function_token_position, FunctionLiteral::FunctionType type, | 1100 int function_token_position, FunctionLiteral::FunctionType type, |
| 1101 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); | 1101 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); |
| 1102 | 1102 |
| 1103 | 1103 |
| 1104 ClassLiteral* ParseClassLiteral(const AstRawString* name, | 1104 ClassLiteral* ParseClassLiteral(const AstRawString* name, |
| 1105 Scanner::Location class_name_location, | 1105 Scanner::Location class_name_location, |
| 1106 bool name_is_strict_reserved, int pos, | 1106 bool name_is_strict_reserved, int pos, |
| 1107 bool* ok); | 1107 bool* ok); |
| 1108 | 1108 |
| 1109 // Magical syntax support. | 1109 // Magical syntax support. |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1339 auto* init_block = | 1339 auto* init_block = |
| 1340 parser_->BuildParameterInitializationBlock(formal_parameters, ok); | 1340 parser_->BuildParameterInitializationBlock(formal_parameters, ok); |
| 1341 if (!*ok) return; | 1341 if (!*ok) return; |
| 1342 if (init_block != nullptr) { | 1342 if (init_block != nullptr) { |
| 1343 body->Add(init_block, parser_->zone()); | 1343 body->Add(init_block, parser_->zone()); |
| 1344 } | 1344 } |
| 1345 } | 1345 } |
| 1346 } } // namespace v8::internal | 1346 } } // namespace v8::internal |
| 1347 | 1347 |
| 1348 #endif // V8_PARSER_H_ | 1348 #endif // V8_PARSER_H_ |
| OLD | NEW |