-
Notifications
You must be signed in to change notification settings - Fork 63
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
Replace Value with Expression in the grammar #1023
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not understanding this PR. It seems to be mostly about renaming the Value AST node to Expression without changing what it means. Is this meant to be a stepping stone towards supporting expressions?
)? | ||
; | ||
|
||
Value: | ||
(parameter=[Parameter] | time=Time | literal=Literal | code=Code); | ||
Expression: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused by this. I would expect an Expression to somehow different from a Value. This looks to me the same as what we used to call a Value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea here is that @cmnrd plans to augment this rule later on. This PR is just meant to set the stage for that.
Yes, this a first step at introducing an expression syntax. This PR only converts what we now call a |
This pass was automated instead of manual. It replaces carriage return/line feed line terminators with just line feed terminators, and it removes trailing whitespace.
This is a manual pass for incorrect indentation.
Fix whitespace in tests
'expressions' has already been approved; we just need to make sure it passes CI. To make that work, it is necessary to merge in changes from 'master'.
The LSP tests have been a hindrance for this branch... sorry. I suspect that if we re-ran the tests, the LSP tests would be more likely to pass than not. This annoying inconsistency exists because I deliberately set them up to use a different random seed each time, on the grounds that as we run CI each day, we might randomly catch more edge cases over time. This time, the LSP tests seem to be failing because the body of the STP handler in |
I can't seem to replicate this issue. The STP handler is being generated for me on PythonC |
I was mistaken; thanks to Soroush for patiently explaining. The real reason for the most recent test failure in this branch is that instead of having I don't feel strongly about this, and I am sure there is a reason for this change. However, I am not convinced that it is the best choice. In |
I think I lean towards reverting the mechanism to opt-out instead of having opt-in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! I guess the only minor aesthetic issue I see that not all developers might initially be aware of what tagging is and whether they should use toText
or toUntaggedText
. Perhaps we can come up with a better name for toUntaggedText
that highlights its typical use case rather than the presence of tags? Maybe toOriginalText
? Or toVerbatimText
? IDK...
Thanks for finishing this up! With regard to the discussion about |
This makes a first step at implementing the spec in #986 by creating an extensible Expression syntax in replacement of the old
Value
rule. In consequence of the grammar changes, this PR also includes a ton of refactoring.This PR is based on #1022 and includes its changes.