-
Notifications
You must be signed in to change notification settings - Fork 20
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
move each OperatorDefinition
to its own Production
#374
Milestone
Comments
OmarTawfik
changed the title
use
move each May 3, 2023
ParserRef
in OperatorDefinition
OperatorDefinition
to its own Production
OmarTawfik
added a commit
that referenced
this issue
May 19, 2023
Allows us to: - de-duplicate large operators across different versions - add names to operators if needed (will do in a following PR) closes #374
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally posted by @OmarTawfik in #332 (comment):
In the current grammar,
name
here is the name of the parent expression node (that contains both the operator and operands). There is no way to define a name for the operator node.Moreover, this shape forces us to duplicate the entire base expression node for each version break in one of the operators. See #432 for example. I suspect these versions will only keep growing, making it harder to read, understand, and diff its contents.
I suggest moving the definition of each
operator
to its ownProduction
(as aParserRef
, where it can be versioned separately. The mainExpression.operators
list can remain unversioned, unless a version actually adds/removes operators, or changes their precedence.Additionally, this includes it in
visit_parser
visitor checks. We don't do that now, which is a bug.This allows us to do:
The text was updated successfully, but these errors were encountered: