Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Side by Side Diff: src/parsing/parser.h

Issue 2164943002: Split NewScope into NewScope and NewScopeWithParent (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 } 535 }
536 536
537 V8_INLINE void AddParameterInitializationBlock( 537 V8_INLINE void AddParameterInitializationBlock(
538 const ParserFormalParameters& parameters, 538 const ParserFormalParameters& parameters,
539 ZoneList<v8::internal::Statement*>* body, bool is_async, bool* ok); 539 ZoneList<v8::internal::Statement*>* body, bool is_async, bool* ok);
540 540
541 void ParseAsyncArrowSingleExpressionBody( 541 void ParseAsyncArrowSingleExpressionBody(
542 ZoneList<Statement*>* body, bool accept_IN, 542 ZoneList<Statement*>* body, bool accept_IN,
543 Type::ExpressionClassifier* classifier, int pos, bool* ok); 543 Type::ExpressionClassifier* classifier, int pos, bool* ok);
544 544
545 V8_INLINE Scope* NewScope(Scope* parent_scope, ScopeType scope_type); 545 V8_INLINE Scope* NewScope(ScopeType scope_type);
546 V8_INLINE Scope* NewFunctionScope(FunctionKind kind); 546 V8_INLINE Scope* NewFunctionScope(FunctionKind kind);
547 V8_INLINE Scope* NewScopeWithParent(Scope* parent, ScopeType scope_type);
547 548
548 V8_INLINE void AddFormalParameter(ParserFormalParameters* parameters, 549 V8_INLINE void AddFormalParameter(ParserFormalParameters* parameters,
549 Expression* pattern, 550 Expression* pattern,
550 Expression* initializer, 551 Expression* initializer,
551 int initializer_end_position, bool is_rest); 552 int initializer_end_position, bool is_rest);
552 V8_INLINE void DeclareFormalParameter( 553 V8_INLINE void DeclareFormalParameter(
553 Scope* scope, const ParserFormalParameters::Parameter& parameter, 554 Scope* scope, const ParserFormalParameters::Parameter& parameter,
554 Type::ExpressionClassifier* classifier); 555 Type::ExpressionClassifier* classifier);
555 void ParseArrowFunctionFormalParameters(ParserFormalParameters* parameters, 556 void ParseArrowFunctionFormalParameters(ParserFormalParameters* parameters,
556 Expression* params, int end_pos, 557 Expression* params, int end_pos,
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 void Print(AstNode* node); 1137 void Print(AstNode* node);
1137 #endif // DEBUG 1138 #endif // DEBUG
1138 }; 1139 };
1139 1140
1140 1141
1141 bool ParserTraits::IsFutureStrictReserved( 1142 bool ParserTraits::IsFutureStrictReserved(
1142 const AstRawString* identifier) const { 1143 const AstRawString* identifier) const {
1143 return parser_->scanner()->IdentifierIsFutureStrictReserved(identifier); 1144 return parser_->scanner()->IdentifierIsFutureStrictReserved(identifier);
1144 } 1145 }
1145 1146
1146 Scope* ParserTraits::NewScope(Scope* parent_scope, ScopeType scope_type) { 1147 Scope* ParserTraits::NewScopeWithParent(Scope* parent, ScopeType scope_type) {
1147 return parser_->NewScope(parent_scope, scope_type); 1148 return parser_->NewScopeWithParent(parent, scope_type);
1149 }
1150
1151 Scope* ParserTraits::NewScope(ScopeType scope_type) {
1152 return parser_->NewScope(scope_type);
1148 } 1153 }
1149 1154
1150 Scope* ParserTraits::NewFunctionScope(FunctionKind kind) { 1155 Scope* ParserTraits::NewFunctionScope(FunctionKind kind) {
1151 return parser_->NewFunctionScope(kind); 1156 return parser_->NewFunctionScope(kind);
1152 } 1157 }
1153 1158
1154 const AstRawString* ParserTraits::EmptyIdentifierString() { 1159 const AstRawString* ParserTraits::EmptyIdentifierString() {
1155 return parser_->ast_value_factory()->empty_string(); 1160 return parser_->ast_value_factory()->empty_string();
1156 } 1161 }
1157 1162
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 1318
1314 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { 1319 DoExpression* ParserTraits::ParseDoExpression(bool* ok) {
1315 return parser_->ParseDoExpression(ok); 1320 return parser_->ParseDoExpression(ok);
1316 } 1321 }
1317 1322
1318 1323
1319 } // namespace internal 1324 } // namespace internal
1320 } // namespace v8 1325 } // namespace v8
1321 1326
1322 #endif // V8_PARSING_PARSER_H_ 1327 #endif // V8_PARSING_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698