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

Unified Diff: src/parsing/parser-base.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 | « src/parsing/parser.cc ('k') | src/parsing/pattern-rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index 5b06e52a95948da3a64266050e466234081cbc18..32cdbd5c16dc05f07bc37f18041bc96fe3b3dee5 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -632,6 +632,40 @@ class ParserBase {
Mode old_mode_;
};
+ struct DeclarationDescriptor {
nickie 2016/08/30 14:04:34 (I'm wondering...) Would it be better if this wer
+ enum Kind { NORMAL, PARAMETER };
+ Scope* scope;
+ Scope* hoist_scope;
+ VariableMode mode;
+ int declaration_pos;
+ int initialization_pos;
+ Kind declaration_kind;
+ };
+
+ struct DeclarationParsingResult {
+ struct Declaration {
+ Declaration(ExpressionT pattern, int initializer_position,
+ ExpressionT initializer)
+ : pattern(pattern),
+ initializer_position(initializer_position),
+ initializer(initializer) {}
+
+ ExpressionT pattern;
+ int initializer_position;
+ ExpressionT initializer;
+ };
+
+ DeclarationParsingResult()
+ : declarations(4),
+ first_initializer_loc(Scanner::Location::invalid()),
+ bindings_loc(Scanner::Location::invalid()) {}
+
+ DeclarationDescriptor descriptor;
+ List<Declaration> declarations;
+ Scanner::Location first_initializer_loc;
+ Scanner::Location bindings_loc;
+ };
+
DeclarationScope* NewScriptScope() const {
return new (zone()) DeclarationScope(zone());
}
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/pattern-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698