julia
296cca23 - Bypass `SyntaxNode` in JuliaLowering; fix `kw` bug (#60162)

Commit
81 days ago
Bypass `SyntaxNode` in JuliaLowering; fix `kw` bug (#60162) The `kw` form isn't produced in `SyntaxNode`/`SyntaxTree` like it is in Expr, which simplifies the parser, but causes problems once we start start caring about the semantics of these trees. Parsing `"f(a=1)"` will always produce an `Expr(:call, :f, Expr(:kw, :a, 1))`, but the equivalent SyntaxNode representation `(call f (= a 1))` makes `Expr(:call, :f, Expr(:(=), :a, 1))` unrepresentable, even though that's valid syntax a macro could produce. To fix this, we need to convert `=` to `kw` within certain forms before macro expansion.
Author
Parents
Loading