support import statements (#4646)

This commit is contained in:
Alex Lam S.L
2021-02-13 20:26:43 +00:00
committed by GitHub
parent a6bb66931b
commit b7219ac489
8 changed files with 312 additions and 10 deletions

View File

@@ -204,6 +204,11 @@ TreeTransformer.prototype = new TreeWalker;
if (self.key instanceof AST_Node) self.key = self.key.transform(tw);
self.value = self.value.transform(tw);
});
DEF(AST_Import, function(self, tw) {
if (self.all) self.all = self.all.transform(tw);
if (self.default) self.default = self.default.transform(tw);
if (self.properties) self.properties = do_list(self.properties, tw);
});
DEF(AST_Template, function(self, tw) {
if (self.tag) self.tag = self.tag.transform(tw);
self.expressions = do_list(self.expressions, tw);