We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ternary_expression
I observed that if a ternary expression is like - false ? "foo" : nil (note the nil), the if_false field does not get populated.
false ? "foo" : nil
nil
if_false
However it works if the the alternative was an expression other than nil ... false ? "foo" : "y" parses ok.
false ? "foo" : "y"
I wonder why nil is not parsed as an expression here - https://github.com/alex-pinkus/tree-sitter-swift/blob/main/grammar.js#L795
The text was updated successfully, but these errors were encountered:
also observed that
if_true
false? nil : x
false ? nil: nil
After tinkering for sometime, i observed that "nil" is the only value for which i observe such a behavior.
Tried to update to _expr_hack_at_ternary_binary_suffix to :
_expr_hack_at_ternary_binary_suffix
_expr_hack_at_ternary_binary_suffix: ($) => prec.left( PRECS.ternary_binary_suffix, choice( "nil", $._expression, alias($.expr_hack_at_ternary_binary_call, $.call_expression) ) )
Didnt work :|
Sorry, something went wrong.
No branches or pull requests
I observed that if a ternary expression is like -
false ? "foo" : nil
(note thenil
), theif_false
field does not get populated.However it works if the the alternative was an expression other than
nil
...false ? "foo" : "y"
parses ok.I wonder why
nil
is not parsed as an expression here - https://github.com/alex-pinkus/tree-sitter-swift/blob/main/grammar.js#L795The text was updated successfully, but these errors were encountered: