-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add a space in complex anonymous functions #236
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.
Do we have tests for chained unary formulas?
It should look like:
~~foo
~~ 1 + 2
// "Complex" is anything except identifiers | ||
!matches!(argument, AnyRExpression::RIdentifier(_)) |
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 would expect ~NA
and ~NULL
to be treated like ~foo
?
And probably other literals like ~10
too?
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 don't think so, I believe that this behavior is only for identifiers. And is somewhat special to supporting tribble calls
tribble(
~x, ~y,
...
)
If not for tribble I would have been happy with unconditionally using a space between the ~
and the rhs, so to me the ~foo
behavior is just a surgical patch to help that, and everything else gets a space
a789fa6
to
937b814
Compare
Closes #235