Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts/ast: ImportSpec #44

Merged
merged 1 commit into from
Dec 16, 2021
Merged

ts/ast: ImportSpec #44

merged 1 commit into from
Dec 16, 2021

Conversation

sh0rez
Copy link
Member

@sh0rez sh0rez commented Dec 10, 2021

Introduces the ast.ImportSpec type, which represents import statements
of the following forms:

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

As a side-effect, ast.File now expects ast.Decl instead of
ast.Node at the top level, to prevent mixing imports (which are not
declarations on purpose) with the actual elements.

Fixes #43

Introduces the `ast.ImportSpec` type, which represents import statements
of the following forms:

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

As a side-effect, `ast.File` now expects `ast.Decl` instead of
`ast.Node` at the top level, to prevent mixing imports (which are not
declarations on purpose) with the actual elements.
@sh0rez sh0rez requested a review from sdboyer December 10, 2021 15:15
Copy link
Contributor

@sdboyer sdboyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sdboyer sdboyer merged commit f590cd0 into main Dec 16, 2021
@sdboyer sdboyer deleted the shorez/ast-imports branch December 16, 2021 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ts/ast: imports
2 participants