-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC: preserve more syntax in parsing ?
, do
, and elseif
#23061
Conversation
@@ -13,13 +13,13 @@ such as a `ccall` to a non-existent function. | |||
""" | |||
macro static(ex) | |||
if isa(ex, Expr) | |||
if ex.head === :if || ex.head === :&& || ex.head === :|| | |||
if ex.head === :if || ex.head === :&& || ex.head === :|| || ex.head === :? |
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.
should @static
also statically resolve elseif conditions?
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.
It could, but that would be more of a new feature, since it was never able to before.
does Line 419 in 7233d7d
|
Yes, it should be updated for |
@nanosoldier |
I will break this into smaller PRs. |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
It's TOO LATE, Nanosoldier. |
A part of #21774 that I find pretty agreeable.
?
- just uses?
as the expression head instead ofif
do
parses as(do <function call expr> <function argument expr>)
if
parses the same as before, except nestedif
s that come fromelseif
useelseif
as the expression head instead ofif
, and are nested directly inside theif
expression without intervening blocks, line nodes, etc. I also tried a flat representation (adding N arguments toif
), but it was hard to deal with. The nested structure is easier since you only need to write code to handle 2- or 3-argumentif
, and treatelseif
the same asif
.This should be non-breaking for users, and a living nightmare for macro authors :)