-
-
Notifications
You must be signed in to change notification settings - Fork 93
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 FnCall #5363
Fix FnCall #5363
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.
This is looking great!
Two thoughts:
-
it'd be great to include, in the grammar.js, some
/** commentary */
onexpression
andsimple_expression
noting why they exist and how they're different -
to that end, I thought the logic there would be "some expressions are really clear where they start/end, and never need parens, and others might need parens () around them to help disambiguate.
But, these three being in simple-expression gave me pause:
$.dict_literal,
, $.record_literal,
$.enum_literal,
Ok well for dicts, the {} make it clear I suppose. and for records, they have the {} and just a quick label to the left. and enum literal, similar to record literal (esp since even for 1 arg we require the ()
to wrap, for now). So, in writing this, I've sort of reconsidered. But, it gave me pause - "isn't there chance for ambiguity when passing one of these into a fn argument?"
Anyway, this is mostly a request for some such commentary in grammar.js, and wanted to think through those 3 cases.
also, I think the answer to
is yes |
…nctions between expression and simple_expression
I've added more tests around this, and a todo to reconsider having enums as a simple_expression. maybe once we remove the parentheses around enum field, it could cause ambiguity (not sure). Thanks for pointing it out |
great work here! |
we accidentally got away from how we normally represent function calls in writtenTypes.dark, this pr fixes it.
function_call
toapply
?#5321