Importing names from places

This commit is contained in:
Fábio Santos
2016-02-21 17:06:09 +00:00
committed by Richard van Velzen
parent 0465bd270d
commit d35a9e7839
5 changed files with 56 additions and 9 deletions

View File

@@ -702,10 +702,19 @@ var AST_Const = DEFNODE("Const", null, {
$documentation: "A `const` statement"
}, AST_Definitions);
var AST_Import = DEFNODE("Import", "module_name", {
var AST_Import = DEFNODE("Import", "imported_name module_name", {
$documentation: "An `import` statement",
$propdoc: {
imported_name: "[AST_SymbolImport] The name of the variable holding the module's default export.",
module_name: "[AST_String] String literal describing where this module came from",
},
_walk: function(visitor) {
return visitor._visit(this, function() {
if (this.imported_name) {
this.imported_name._walk(visitor);
}
this.module_name._walk(visitor);
});
}
});
@@ -1072,6 +1081,10 @@ var AST_SymbolCatch = DEFNODE("SymbolCatch", null, {
$documentation: "Symbol naming the exception in catch",
}, AST_SymbolDeclaration);
var AST_SymbolImport = DEFNODE("SymbolImport", null, {
$documentation: "Symbol refering to an imported name",
}, AST_SymbolDeclaration);
var AST_Label = DEFNODE("Label", "references", {
$documentation: "Symbol naming a label (declaration)",
$propdoc: {