🐛 Make clause guard field/tuple access recursive#138
Merged
the-mikedavis merged 3 commits intogleam-lang:mainfrom Jan 5, 2026
Merged
🐛 Make clause guard field/tuple access recursive#138the-mikedavis merged 3 commits intogleam-lang:mainfrom
the-mikedavis merged 3 commits intogleam-lang:mainfrom
Conversation
Comment on lines
+316
to
+319
| (field_access | ||
| record: (identifier) | ||
| field: (label) | ||
| field: (label))) |
Member
There was a problem hiding this comment.
Rather than multiple index/field fields, let's make this nested so instead it would be:
(field_access
record:
(field_access
record: (identifier)
field: (label))
field: (label))Especially when mixing records and tuples, having field on a tuple_access or index or a field_access doesn't make sense.
Contributor
Author
There was a problem hiding this comment.
Ah, you're right! I modeled this closely after how it's implemented in normal expressions, I'll have to check why it behaves differently
Contributor
Author
There was a problem hiding this comment.
I was pulling my hair out over this, but it was just a missing alias 🤦
It was recursive, the recursive nodes were just dropped.
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.
Clause guards only allowed tuple/field access with a depth of one.
All of these could not be parsed correctly:
Note I'm way out of my depth with this one: Please pay special attention to the conflicts I added, I don't really know how to judge if they are okay! Feedback or direct edits are both welcome!