Skip to content

Commit

Permalink
docs(ast): add AST for the module attribute proposal
Browse files Browse the repository at this point in the history
Introduce a `ImportModuleAttribute` structure and add an `attributes` key on
the `ImportDeclaration` node.
  • Loading branch information
xtuc committed Jan 15, 2020
1 parent e7961a0 commit a2824db
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/babel-parser/ast/spec.md
Expand Up @@ -107,6 +107,7 @@ These are the core @babel/parser (babylon) AST node types.
- [ImportSpecifier](#importspecifier)
- [ImportDefaultSpecifier](#importdefaultspecifier)
- [ImportNamespaceSpecifier](#importnamespacespecifier)
- [ImportModuleAttribute](#importmoduleattribute)
- [Exports](#exports)
- [ExportNamedDeclaration](#exportnameddeclaration)
- [ExportSpecifier](#exportspecifier)
Expand Down Expand Up @@ -1221,6 +1222,7 @@ interface ImportDeclaration <: ModuleDeclaration {
importKind: null | "type" | "typeof" | "value";
specifiers: [ ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier ];
source: Literal;
attributes?: [ ImportModuleAttribute ];
}
```

Expand Down Expand Up @@ -1259,6 +1261,18 @@ interface ImportNamespaceSpecifier <: ModuleSpecifier {

A namespace import specifier, e.g., `* as foo` in `import * as foo from "mod.js"`.

### ImportModuleAttribute

```js
interface ImportModuleAttribute <: Node {
type: "ImportModuleAttribute";
key: Identifier;
value: StringLiteral;
}
```

An attribute specified on the ImportDeclaration.

## Exports

### ExportNamedDeclaration
Expand Down

0 comments on commit a2824db

Please sign in to comment.