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

fix the general -> primary -> parenthesized expression hierarchy #29

Merged
merged 3 commits into from
Jan 13, 2025

Conversation

janw4ld
Copy link
Contributor

@janw4ld janw4ld commented Jan 13, 2025

this PR

  • renames _prefix_expression to _primary_expression to match a more common & conventional name
  • correctly categorises all primary expression kinds in the grammar as such
  • makes _primary_expression a child/subkind of _expression
  • makes parenthesized_expression a child of _primary_expression

this fixes a class of shortcomings that prevent parsing parenthesised expressions that evaluate to simple objects from being treated as objects everywhere in the grammar.

this addresses the first shortcoming stated in #28
image

@murtaza64
Copy link
Owner

It seems like you know the Groovy grammar better than I do. Out of curiosity, was this stuff described in the language spec at all?

@murtaza64 murtaza64 merged commit 2bc6ce4 into murtaza64:main Jan 13, 2025
@janw4ld
Copy link
Contributor Author

janw4ld commented Jan 13, 2025

not really, i haven't read the language spec but im learning about programming language design in general and comparing groovy to java and python

@janw4ld janw4ld deleted the primary_expr branch January 13, 2025 20:19
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