parser: fix tuple field parsing in offset_of expansion - #23320
Open
Pewpenguin wants to merge 1 commit into
Open
Conversation
ChayimFriedman2
requested changes
Sep 8, 2026
Contributor
There was a problem hiding this comment.
The flat things makes this already-hacky thing super duper hacky. I don't want that.
Instead we should go back to basics. A float split event should just take the current pending float, and split it, so that the next two/three tokens are INT_NUMBER, DOT and perhaps another INT_NUMBER. This is not possible to do literally, but possible to emulate quite well. The plan is:
- The parser has a
split_float()method. This methods does two things: emit aFloatSplitHack { ends_in_dot }event, and also changes a field inParserto signal "we've split a float". This field will be anenum FloatSplitStage { None, BeforeFirstInt, BeforeDot, BeforeSecondInt }and peek/bump methods will consider it. - The parser, when needed, will just call this method then proceeds to do parsing normally.
- Consumers of the parser's events will also have a field similar to the parser's to track in-flight splitting (we can't split more than one float at a time).
Pewpenguin
force-pushed
the
fix/23178
branch
from
September 9, 2026 08:07
a109527 to
f4f85c9
Compare
This file contains hidden or 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
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.
Fixes #23178.
Fix tuple field parsing in offset_of expansions.
Added a parser test for tuple field paths.