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

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: . 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
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index 35711b068f92b59adc3527e61cd3936692bb8a0c..07e2a356a356c03ef09122280c0e3754a9aa25aa 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -765,14 +765,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 {
+ const AstRawString* import_name;
+ const AstRawString* local_name;
+ const Scanner::Location location;
+ NamedImport(const AstRawString* import_name, const AstRawString* local_name,
+ const Scanner::Location location)
adamk 2016/07/13 18:38:22 No need for "const" here.
neis 2016/07/14 10:28:24 Done.
+ : 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);
@@ -1025,6 +1035,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);

Powered by Google App Engine
This is Rietveld 408576698