-
Notifications
You must be signed in to change notification settings - Fork 45
Fix #3. Use { and } for explicit grouping #21
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
Conversation
| member-expression | ||
| call-expression | ||
| placeable |
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.
why placeable?
key = { { $foo } ->
[one] Value
}
is that intended to work?
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.
Yes. It's not what the serializer would normally serialize to, but I don't think we need to artificially limit the syntax here. It doesn't change the meaning compared to just using $foo
, just like (1) === 1
in JavaScript.
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.
So, what's the use case?
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.
The use case is tightly related to #4. In particular, we need a way to remove the ambiguity from call-expressions
with multiple arguments, some of them being select-expressions
:
key = { LIST(foo, { bar, baz ->
[bar, baz] Bar and Baz
}) }
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.
r+
Thanks for the review. After talking to @Pike last Friday I partly changed my mind about ASDL. The
I updated the PR to reflect that. It should map closely to the data structures we'll have in the Rust implementation. @zbraniecki, this probably doesn't need another review from you, but I wanted to let you know before I merge. |
This only changes the EBNF grammar and doesn't change the ASDL. The grouping is supposed to help the parser in potentially ambiguous situations. Once the parser figures out the parse tree, the final AST will be unambiguous.