-
Notifications
You must be signed in to change notification settings - Fork 2
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
lexer+parser: many improvements and cleanups #985
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- This change moves away from the parser bits "directly" accessing `TokenKind::Tree(..)`s in preparation for using the new lexing system. - Furthermore, the parser now uses either `skip_token()` which in the future will be a "safe" variant of setting the cursor, or `skip_fast()` which should be used to skip atomic tokens (like `;` or `,`). - Remove access to `backtrack()` completely. - Use `peek_kind()` where possible to simplify token matching. - Prepare for removing `peek_nth()` - Prepare for switching over to a new `TokenCursor` API.
This commit switches over the sources of the `v2` lexer over the original lexer source and hooks it up with the rest of the parsing pipeline. This commit uses the new `v2` experimental lexer for the parser which now accepts the "flat" version of the token stream. Since much work was done before this commit to abstract away dealing with the token trees. The migration was reasonably simple (with some minor span calculation adjustments).
…s()` or `expected_pos()`
feds01
added
parser
Issues related with parsing sub-system.
interface
Issues that are regarding the compiler ui, specifically how the user interacts with the compiler
labels
Sep 18, 2023
kontheocharis
previously approved these changes
Sep 19, 2023
feds01
force-pushed
the
lexer-experiment
branch
from
September 19, 2023 15:29
c95e77f
to
0a1f509
Compare
kontheocharis
approved these changes
Sep 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
DelimiterVariant
AstGenFrame::token_at()
offset
inAstGenFrame
->
and=>
tokens to simplify parsing & error reporting::
tokens to simplify parsing access expr/ty/patsbegins_pat()
implementationpeek_nth()
in binary expression parsing..
,..<
,...
tokens to simplify spread/range parsingTokenCursor
APInext_pos()
functionnext_pos()
and replace witheof_pos()
orexpected_pos()
ByteRange
to be inclusive on both ends