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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 FunctionKind kind = kNormalFunction); | 781 FunctionKind kind = kNormalFunction); |
782 | 782 |
783 V8_INLINE void DeclareFormalParameter( | 783 V8_INLINE void DeclareFormalParameter( |
784 ParserFormalParameterParsingState* parsing_state, Expression* name, | 784 ParserFormalParameterParsingState* parsing_state, Expression* name, |
785 ExpressionClassifier* classifier, bool is_rest); | 785 ExpressionClassifier* classifier, bool is_rest); |
786 void ParseArrowFunctionFormalParameters( | 786 void ParseArrowFunctionFormalParameters( |
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); |
| 792 |
791 // Temporary glue; these functions will move to ParserBase. | 793 // Temporary glue; these functions will move to ParserBase. |
792 Expression* ParseV8Intrinsic(bool* ok); | 794 Expression* ParseV8Intrinsic(bool* ok); |
793 FunctionLiteral* ParseFunctionLiteral( | 795 FunctionLiteral* ParseFunctionLiteral( |
794 const AstRawString* name, Scanner::Location function_name_location, | 796 const AstRawString* name, Scanner::Location function_name_location, |
795 bool name_is_strict_reserved, FunctionKind kind, | 797 bool name_is_strict_reserved, FunctionKind kind, |
796 int function_token_position, FunctionLiteral::FunctionType type, | 798 int function_token_position, FunctionLiteral::FunctionType type, |
797 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); | 799 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); |
798 V8_INLINE void SkipLazyFunctionBody( | 800 V8_INLINE void SkipLazyFunctionBody( |
799 int* materialized_literal_count, int* expected_property_count, bool* ok, | 801 int* materialized_literal_count, int* expected_property_count, bool* ok, |
800 Scanner::BookmarkScope* bookmark = nullptr); | 802 Scanner::BookmarkScope* bookmark = nullptr); |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 auto* init_block = | 1339 auto* init_block = |
1338 parser_->BuildParameterInitializationBlock(formal_parameters, ok); | 1340 parser_->BuildParameterInitializationBlock(formal_parameters, ok); |
1339 if (!*ok) return; | 1341 if (!*ok) return; |
1340 if (init_block != nullptr) { | 1342 if (init_block != nullptr) { |
1341 body->Add(init_block, parser_->zone()); | 1343 body->Add(init_block, parser_->zone()); |
1342 } | 1344 } |
1343 } | 1345 } |
1344 } } // namespace v8::internal | 1346 } } // namespace v8::internal |
1345 | 1347 |
1346 #endif // V8_PARSER_H_ | 1348 #endif // V8_PARSER_H_ |
OLD | NEW |