Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Scan bigger/fewer jsdoc tokens #53081
Scan bigger/fewer jsdoc tokens #53081
Changes from 14 commits
d8fd395
701d4fa
716ba47
368bfb6
8ddbf23
95dbeb2
f8f9721
3d96fa9
9f4daf5
a803a1f
b9da7f0
2ab197b
0f4ac62
42d357a
d7c2377
dd92575
76813c0
9427037
c91de88
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 a stupid nit, but I was tricked into thinking this token could be returned from
token()
before any other token because it comes first in the list. Maybe I would have not misunderstood had the case not been added at the top, but, I don't think it actually matters.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.
Is there a better place for it? I put it at the top because I thought it would be the most common and--who knows--maybe switch performance is order dependent. Except that with the improved scanner, it's not really more common than any other token.
Probably down with
default
is the best place.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.
I probably would have stuck it at the bottom, but, I don't really mind either way. Just a silly brain thing from me trying to understand the state machine.
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 slices whitespace, then you slice out of the whitespace. Swap this to grab the beginning/end of the whitespace, calculate the length, and slice right out of the original
sourceText
only if necessary.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.
That's a good idea. I noted it and will try it in a separate PR.
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.
Done: #53121
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.
Just now noticing the parallel between this comment and the previous ones. Given people can call our scanner themselves, maybe I was wrong and this should be public so that no undocumented kinds are returned from
token
?