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

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: Rebase and make DefaultInitializationFlag static. 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
« no previous file with comments | « src/ast/ast.cc ('k') | 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 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 1068
1069 // Insert initializer statements for var-bindings shadowing parameter bindings 1069 // Insert initializer statements for var-bindings shadowing parameter bindings
1070 // from a non-simple parameter list. 1070 // from a non-simple parameter list.
1071 void InsertShadowingVarBindingInitializers(Block* block); 1071 void InsertShadowingVarBindingInitializers(Block* block);
1072 1072
1073 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3 1073 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3
1074 void InsertSloppyBlockFunctionVarBindings(DeclarationScope* scope, 1074 void InsertSloppyBlockFunctionVarBindings(DeclarationScope* scope,
1075 Scope* complex_params_scope, 1075 Scope* complex_params_scope,
1076 bool* ok); 1076 bool* ok);
1077 1077
1078 // Parser support 1078 static InitializationFlag DefaultInitializationFlag(VariableMode mode);
1079 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); 1079 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode);
1080 Variable* Declare(Declaration* declaration, 1080 Variable* Declare(Declaration* declaration,
1081 DeclarationDescriptor::Kind declaration_kind, bool* ok, 1081 DeclarationDescriptor::Kind declaration_kind,
1082 InitializationFlag init, bool* ok,
1082 Scope* declaration_scope = nullptr); 1083 Scope* declaration_scope = nullptr);
1083 void DeclareConstVariable(const AstRawString* name, InitializationFlag init, 1084 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode,
1084 int pos, bool* ok); 1085 int pos, bool* ok);
1086 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode,
1087 InitializationFlag init, int pos, bool* ok);
1085 1088
1086 bool TargetStackContainsLabel(const AstRawString* label); 1089 bool TargetStackContainsLabel(const AstRawString* label);
1087 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); 1090 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok);
1088 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); 1091 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok);
1089 1092
1090 Statement* BuildAssertIsCoercible(Variable* var); 1093 Statement* BuildAssertIsCoercible(Variable* var);
1091 1094
1092 // Factory methods. 1095 // Factory methods.
1093 FunctionLiteral* DefaultConstructor(const AstRawString* name, bool call_super, 1096 FunctionLiteral* DefaultConstructor(const AstRawString* name, bool call_super,
1094 int pos, int end_pos, 1097 int pos, int end_pos,
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 1363
1361 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { 1364 DoExpression* ParserTraits::ParseDoExpression(bool* ok) {
1362 return parser_->ParseDoExpression(ok); 1365 return parser_->ParseDoExpression(ok);
1363 } 1366 }
1364 1367
1365 1368
1366 } // namespace internal 1369 } // namespace internal
1367 } // namespace v8 1370 } // namespace v8
1368 1371
1369 #endif // V8_PARSING_PARSER_H_ 1372 #endif // V8_PARSING_PARSER_H_
OLDNEW
« no previous file with comments | « src/ast/ast.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698