Skip to content
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

Simplify enum_variant_pattern rule #44

Merged
merged 1 commit into from
May 29, 2024

Conversation

yannham
Copy link
Contributor

@yannham yannham commented May 28, 2024

Instead of instantiating patternF manually, we can actually reuse the rule pattern_fun within the enum_variant_pattern, which makes things a bit more consistent and will help on the Topiary formatting side.

Passing by, we also removed the unused last parameter passed to the various xxxF macro rules - this was copied from LALRPOP but doesn't make sense currently in the tree-sitter grammar. Fortunately (or not?) additional arguments are just ignored in JavaScript, so this shouldn't change anything in practice, but is less confusing to future readers of the grammar.

Instead of instantiating `patternF` manually, we can actually reuse the
rule `pattern_fun` within the `enum_variant_pattern`, which makes things
a bit more consistent and will help on the Topiary formatting side.

Passing by, we also removed the unused last parameter passed to the
various xxxF macro rules - this was copied from LALRPOP but doesn't make
sense currently in the tree-sitter grammar. Fortunately (or not?)
additional arguments are just ignored in JavaScript, so this shouldn't
change anything in practice, but is less confusing to future readers of
the grammar.
@yannham yannham merged commit 0a796f3 into main May 29, 2024
1 check passed
@ErinvanderVeen ErinvanderVeen deleted the fix/enum-variant-reuse-pattern-fun branch May 29, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants