-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
refactor(js_grammar): improve representation of imports #1163
Conversation
✅ Deploy Preview for biomejs canceled.
|
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
083960b
to
93cf8da
Compare
93cf8da
to
d9c8c8f
Compare
|
||
× expected `from` but instead found `*` | ||
|
||
> 1 │ import defer * as ns from "x"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer reported because this is recovered as a combined import clause (defer
is the default specifier). Not sure why it didn't error asking for a comma?
match p.cur() { | ||
T![,] | T!['{'] => { | ||
let syntax_type = match p.cur() { | ||
T![,] | T!['{'] | T![*] => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is responsible for the behavior change discussed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🦄
Summary
This implements the proposal I made in the corresponding discussion.
This refactoring provides several advantages:
Test Plan
I updated the parser tests and the associated snapshots.