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_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 } | 538 } |
539 | 539 |
540 V8_INLINE void AddParameterInitializationBlock( | 540 V8_INLINE void AddParameterInitializationBlock( |
541 const ParserFormalParameters& parameters, | 541 const ParserFormalParameters& parameters, |
542 ZoneList<v8::internal::Statement*>* body, bool is_async, bool* ok); | 542 ZoneList<v8::internal::Statement*>* body, bool is_async, bool* ok); |
543 | 543 |
544 void ParseAsyncArrowSingleExpressionBody( | 544 void ParseAsyncArrowSingleExpressionBody( |
545 ZoneList<Statement*>* body, bool accept_IN, | 545 ZoneList<Statement*>* body, bool accept_IN, |
546 Type::ExpressionClassifier* classifier, int pos, bool* ok); | 546 Type::ExpressionClassifier* classifier, int pos, bool* ok); |
547 | 547 |
548 V8_INLINE Scope* NewScope(Scope* parent_scope, ScopeType scope_type, | 548 V8_INLINE Scope* NewScope(Scope* parent_scope, ScopeType scope_type); |
549 FunctionKind kind = kNormalFunction); | 549 V8_INLINE Scope* NewFunctionScope(Scope* parent_scope, FunctionKind kind); |
550 | 550 |
551 V8_INLINE void AddFormalParameter(ParserFormalParameters* parameters, | 551 V8_INLINE void AddFormalParameter(ParserFormalParameters* parameters, |
552 Expression* pattern, | 552 Expression* pattern, |
553 Expression* initializer, | 553 Expression* initializer, |
554 int initializer_end_position, bool is_rest); | 554 int initializer_end_position, bool is_rest); |
555 V8_INLINE void DeclareFormalParameter( | 555 V8_INLINE void DeclareFormalParameter( |
556 Scope* scope, const ParserFormalParameters::Parameter& parameter, | 556 Scope* scope, const ParserFormalParameters::Parameter& parameter, |
557 Type::ExpressionClassifier* classifier); | 557 Type::ExpressionClassifier* classifier); |
558 void ParseArrowFunctionFormalParameters(ParserFormalParameters* parameters, | 558 void ParseArrowFunctionFormalParameters(ParserFormalParameters* parameters, |
559 Expression* params, int end_pos, | 559 Expression* params, int end_pos, |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 void Print(AstNode* node); | 1139 void Print(AstNode* node); |
1140 #endif // DEBUG | 1140 #endif // DEBUG |
1141 }; | 1141 }; |
1142 | 1142 |
1143 | 1143 |
1144 bool ParserTraits::IsFutureStrictReserved( | 1144 bool ParserTraits::IsFutureStrictReserved( |
1145 const AstRawString* identifier) const { | 1145 const AstRawString* identifier) const { |
1146 return parser_->scanner()->IdentifierIsFutureStrictReserved(identifier); | 1146 return parser_->scanner()->IdentifierIsFutureStrictReserved(identifier); |
1147 } | 1147 } |
1148 | 1148 |
1149 | 1149 Scope* ParserTraits::NewScope(Scope* parent_scope, ScopeType scope_type) { |
1150 Scope* ParserTraits::NewScope(Scope* parent_scope, ScopeType scope_type, | 1150 return parser_->NewScope(parent_scope, scope_type); |
1151 FunctionKind kind) { | |
1152 return parser_->NewScope(parent_scope, scope_type, kind); | |
1153 } | 1151 } |
1154 | 1152 |
| 1153 Scope* ParserTraits::NewFunctionScope(Scope* parent_scope, FunctionKind kind) { |
| 1154 return parser_->NewFunctionScope(parent_scope, kind); |
| 1155 } |
1155 | 1156 |
1156 const AstRawString* ParserTraits::EmptyIdentifierString() { | 1157 const AstRawString* ParserTraits::EmptyIdentifierString() { |
1157 return parser_->ast_value_factory()->empty_string(); | 1158 return parser_->ast_value_factory()->empty_string(); |
1158 } | 1159 } |
1159 | 1160 |
1160 | 1161 |
1161 void ParserTraits::SkipLazyFunctionBody(int* materialized_literal_count, | 1162 void ParserTraits::SkipLazyFunctionBody(int* materialized_literal_count, |
1162 int* expected_property_count, bool* ok, | 1163 int* expected_property_count, bool* ok, |
1163 Scanner::BookmarkScope* bookmark) { | 1164 Scanner::BookmarkScope* bookmark) { |
1164 return parser_->SkipLazyFunctionBody(materialized_literal_count, | 1165 return parser_->SkipLazyFunctionBody(materialized_literal_count, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 | 1316 |
1316 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1317 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1317 return parser_->ParseDoExpression(ok); | 1318 return parser_->ParseDoExpression(ok); |
1318 } | 1319 } |
1319 | 1320 |
1320 | 1321 |
1321 } // namespace internal | 1322 } // namespace internal |
1322 } // namespace v8 | 1323 } // namespace v8 |
1323 | 1324 |
1324 #endif // V8_PARSING_PARSER_H_ | 1325 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |