These are ERRORs. They aren't supposed to be, though, because if we run the following Julia program:
macro test(thing)
println(thing)
end
@test 2 ? :(3) : 5
we get
if 2
$(QuoteNode(3))
else
5
end
(and similarly for if you replace : with $)
Why:
This is not in line with the fact that this is a legitimate Julia program.
Some real Julia programs on Github failed to parse because of essentially this.
How:
Just made the precedence for colon-quote, the precedence that governs interpolation_expression and quote_expression, tighter. This makes it so that it binds properly when nested within something else, like a conditional, for instance.
What: Currently, parsing these Julia programs:
results in
These are ERRORs. They aren't supposed to be, though, because if we run the following Julia program:
we get
(and similarly for if you replace
:
with$
)Why: This is not in line with the fact that this is a legitimate Julia program.
Some real Julia programs on Github failed to parse because of essentially this.
How: Just made the precedence for
colon-quote
, the precedence that governsinterpolation_expression
andquote_expression
, tighter. This makes it so that it binds properly when nested within something else, like a conditional, for instance.