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

Missing tokens in 0.21.7 #728

Closed
dsherret opened this issue Mar 25, 2020 · 4 comments · Fixed by #731
Closed

Missing tokens in 0.21.7 #728

dsherret opened this issue Mar 25, 2020 · 4 comments · Fixed by #731
Labels

Comments

@dsherret
Copy link
Contributor

Describe the bug

Tokens are missing in the output and are not captured.

Input code

export interface ResolvableMethods {
}

Expected behavior

Five tokens.

Actual behaviour

Only two:

Token: TokenAndSpan { token: Word(export), had_line_break: true, span: Span { lo: BytePos(0), hi: BytePos(6), ctxt: #0 } }
Token: TokenAndSpan { token: Word(interface), had_line_break: false, span: Span { lo: BytePos(7), hi: BytePos(16), ctxt: #0 } }

Version

parser 0.21.7

Additional context

Related to fix for #726. I was thinking that perhaps instead of doing a "revert" it could instead only capture a token if the lo position is greater than the previous token's lo position?

@kdy1
Copy link
Member

kdy1 commented Mar 25, 2020

@dsherret Oh.. It seems like a great idea. I'll do it tommorow (as it's time to go bed in my country)

@dsherret
Copy link
Contributor Author

@kdy1 sounds good! I pegged the swc version to 0.21.6 on my side in the meantime, so no rush.

Thanks and have a good sleep!

kdy1 added a commit to kdy1/swc that referenced this issue Mar 26, 2020
@kdy1 kdy1 mentioned this issue Mar 26, 2020
@kdy1 kdy1 closed this as completed in #731 Mar 26, 2020
kdy1 added a commit that referenced this issue Mar 26, 2020
Fix token capturing (Closes #728)
@dsherret
Copy link
Contributor Author

@kdy1 it works well. Thanks 🙂

@swc-bot
Copy link
Collaborator

swc-bot commented Oct 28, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants