-
Notifications
You must be signed in to change notification settings - Fork 48
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
weird loc tracking #161
Comments
That sounds right. I knew meriyah always put leading space into next token. What parser issue did this quirk contribute to? |
I just compared Meriyah output against my private code when I noticed this. I don't know about any real world cases except maybe for Prettier? |
@3cp ideas for an fix? |
The test tests scanned token by skipping comments. It looks fine. I have cleaned up the whitespace unit tests file for some missing check. |
@3cp See this test? https://github.com/meriyah/meriyah/blob/master/test/lexer/whitespace.ts#L228
Single line comment shouldn't have any LT - it should break. So shouldn't this test simply have zero LT and
hasNext
set to true?Next time you invoke the
nextToken
it should consume the line terminator.There are other similar tests too.
https://github.com/meriyah/meriyah/blob/master/test/lexer/whitespace.ts#L641
Here shouldn't the index stop at 5 and not 8?
cc / @fisker What do you think?
The text was updated successfully, but these errors were encountered: