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

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

Issue 2223843002: [ast][parsing] Variable declaration cleanups. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use DefaultInitializationFlag in more places. Created 4 years, 4 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
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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 1072
1073 // Insert initializer statements for var-bindings shadowing parameter bindings 1073 // Insert initializer statements for var-bindings shadowing parameter bindings
1074 // from a non-simple parameter list. 1074 // from a non-simple parameter list.
1075 void InsertShadowingVarBindingInitializers(Block* block); 1075 void InsertShadowingVarBindingInitializers(Block* block);
1076 1076
1077 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3 1077 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3
1078 void InsertSloppyBlockFunctionVarBindings(DeclarationScope* scope, 1078 void InsertSloppyBlockFunctionVarBindings(DeclarationScope* scope,
1079 Scope* complex_params_scope, 1079 Scope* complex_params_scope,
1080 bool* ok); 1080 bool* ok);
1081 1081
1082 // Parser support 1082 InitializationFlag DefaultInitializationFlag(VariableMode mode);
1083 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); 1083 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode);
1084 Variable* Declare(Declaration* declaration, 1084 Variable* Declare(Declaration* declaration,
1085 DeclarationDescriptor::Kind declaration_kind, bool resolve, 1085 DeclarationDescriptor::Kind declaration_kind,
1086 bool* ok, Scope* declaration_scope = nullptr); 1086 InitializationFlag init, bool resolve, bool* ok,
1087 void DeclareConstVariable(const AstRawString* name, InitializationFlag init, 1087 Scope* declaration_scope = nullptr);
1088 int pos, bool* ok); 1088 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode,
1089 int pos, bool* ok);
1090 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode,
1091 InitializationFlag init, int pos, bool* ok);
1089 1092
1090 bool TargetStackContainsLabel(const AstRawString* label); 1093 bool TargetStackContainsLabel(const AstRawString* label);
1091 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); 1094 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok);
1092 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); 1095 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok);
1093 1096
1094 Statement* BuildAssertIsCoercible(Variable* var); 1097 Statement* BuildAssertIsCoercible(Variable* var);
1095 1098
1096 // Factory methods. 1099 // Factory methods.
1097 FunctionLiteral* DefaultConstructor(const AstRawString* name, bool call_super, 1100 FunctionLiteral* DefaultConstructor(const AstRawString* name, bool call_super,
1098 int pos, int end_pos, 1101 int pos, int end_pos,
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 1367
1365 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { 1368 DoExpression* ParserTraits::ParseDoExpression(bool* ok) {
1366 return parser_->ParseDoExpression(ok); 1369 return parser_->ParseDoExpression(ok);
1367 } 1370 }
1368 1371
1369 1372
1370 } // namespace internal 1373 } // namespace internal
1371 } // namespace v8 1374 } // namespace v8
1372 1375
1373 #endif // V8_PARSING_PARSER_H_ 1376 #endif // V8_PARSING_PARSER_H_
OLDNEW
« no previous file with comments | « src/ast/ast.cc ('k') | src/parsing/parser.cc » ('j') | src/parsing/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698