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

Unified Diff: src/parsing/parser.h

Issue 2297643002: Move DeclarationDescriptor to ParserBase. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | src/parsing/parser-base.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index 92ab770a9fbecc05fc0005cadf22f538abfe1d3f..4459b2338e18a6e685b2413968c072b2edd02327 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -295,54 +295,21 @@ class Parser : public ParserBase<Parser> {
bool default_export, bool* ok);
Statement* ParseNativeDeclaration(bool* ok);
Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok);
+ Block* BuildInitializationBlock(DeclarationParsingResult* parsing_result,
+ ZoneList<const AstRawString*>* names,
+ bool* ok);
+
Block* ParseVariableStatement(VariableDeclarationContext var_context,
ZoneList<const AstRawString*>* names,
bool* ok);
DoExpression* ParseDoExpression(bool* ok);
Expression* ParseYieldStarExpression(bool* ok);
- struct DeclarationDescriptor {
- enum Kind { NORMAL, PARAMETER };
- Parser* parser;
- Scope* scope;
- Scope* hoist_scope;
- VariableMode mode;
- int declaration_pos;
- int initialization_pos;
- Kind declaration_kind;
- };
-
- struct DeclarationParsingResult {
- struct Declaration {
- Declaration(Expression* pattern, int initializer_position,
- Expression* initializer)
- : pattern(pattern),
- initializer_position(initializer_position),
- initializer(initializer) {}
-
- Expression* pattern;
- int initializer_position;
- Expression* initializer;
- };
-
- DeclarationParsingResult()
- : declarations(4),
- first_initializer_loc(Scanner::Location::invalid()),
- bindings_loc(Scanner::Location::invalid()) {}
-
- Block* BuildInitializationBlock(ZoneList<const AstRawString*>* names,
- bool* ok);
-
- DeclarationDescriptor descriptor;
- List<Declaration> declarations;
- Scanner::Location first_initializer_loc;
- Scanner::Location bindings_loc;
- };
-
class PatternRewriter final : public AstVisitor<PatternRewriter> {
public:
static void DeclareAndInitializeVariables(
- Block* block, const DeclarationDescriptor* declaration_descriptor,
+ Parser* parser, Block* block,
+ const DeclarationDescriptor* declaration_descriptor,
const DeclarationParsingResult::Declaration* declaration,
ZoneList<const AstRawString*>* names, bool* ok);
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | src/parsing/parser-base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698