benjamn / ast-types

Esprima-compatible implementation of the Mozilla JS Parser API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`import * as foo from "foo"`

caridy opened this issue · comments

@benjamn, we need to expand the definition of ImportDeclaration to include support for a new kind of import, as today, we have named and default, as in this block:

def("ImportDeclaration")
    .bases("Declaration")
    .build("specifiers", "kind", "source")
    .field("specifiers", [def("ImportSpecifier")])
    .field("kind", or("named", "default"))
    .field("source", ModuleSpecifier);

I will suggest batch or binding, but I'm pretty bad naming things.

Once we decide on the name, I can finish the work on esprima to get the new syntax in.

I would suggest star (or maybe glob, though that's less immediately understandable).

I like glob :)

ok, closing this in favor of ImportGlobSpecifier and ImportDefaultSpecifier due to the necessity of mixing all them in the same ImportDeclaration, e.g.:

import foo, * as bar, {baz} from "foo";