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

Unified Diff: src/parsing/parser.h

Issue 2108193003: [modules] AST and parser rework. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@anonymous-declarations
Patch Set: Rebase. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
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 a6a6a9e7143c69fcc4bc8e7b8ea600cf5f2e6301..76611dfae55bdc4fe6e92aa2fc2c06b574d5f983 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -666,6 +666,7 @@ class ParserTraits {
void SetFunctionNameFromIdentifierRef(Expression* value,
Expression* identifier);
+ void SetFunctionName(Expression* value, const AstRawString* name);
// Rewrite expressions that are not used as patterns
V8_INLINE void RewriteNonPattern(Type::ExpressionClassifier* classifier,
@@ -765,14 +766,24 @@ class Parser : public ParserBase<ParserTraits> {
void* ParseModuleItemList(ZoneList<Statement*>* body, bool* ok);
Statement* ParseModuleItem(bool* ok);
const AstRawString* ParseModuleSpecifier(bool* ok);
- Statement* ParseImportDeclaration(bool* ok);
+ void* ParseImportDeclaration(bool* ok);
Statement* ParseExportDeclaration(bool* ok);
Statement* ParseExportDefault(bool* ok);
void* ParseExportClause(ZoneList<const AstRawString*>* export_names,
ZoneList<Scanner::Location>* export_locations,
ZoneList<const AstRawString*>* local_names,
Scanner::Location* reserved_loc, bool* ok);
- ZoneList<ImportDeclaration*>* ParseNamedImports(int pos, bool* ok);
+ struct NamedImport : public ZoneObject {
+ const AstRawString* import_name;
+ const AstRawString* local_name;
+ const Scanner::Location location;
+ NamedImport(const AstRawString* import_name, const AstRawString* local_name,
+ Scanner::Location location)
+ : import_name(import_name),
+ local_name(local_name),
+ location(location) {}
+ };
+ ZoneList<const NamedImport*>* ParseNamedImports(int pos, bool* ok);
Statement* ParseStatement(ZoneList<const AstRawString*>* labels,
AllowLabelledFunctionStatement allow_function,
bool* ok);
@@ -1026,6 +1037,7 @@ class Parser : public ParserBase<ParserTraits> {
Variable* Declare(Declaration* declaration,
DeclarationDescriptor::Kind declaration_kind, bool resolve,
bool* ok, Scope* declaration_scope = nullptr);
+ void* DeclareImport(const AstRawString* local_name, int pos, bool* ok);
bool TargetStackContainsLabel(const AstRawString* label);
BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok);
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698