-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
needs newsA NEWS entry is required for this changeA NEWS entry is required for this changeparserLanguage parsing and surface syntaxLanguage parsing and surface syntax
Description
I understand this change simplifies things a lot (I guess it's #46372), but I believe the behavior is a little bit breaking (because the AST is different across versions, e.g it's breaking Expronicon's unit tests) and perhaps should be mentioned somewhere in the NEWS.
in 1.10+
julia> ex = :(function (x::Int; kw=1) end)
:(function (x::Int,; kw = 1)
#= REPL[1]:1 =#
#= REPL[1]:1 =#
end)
julia> ex.args[1].head
:tuple
julia> ex.args[1].args
2-element Vector{Any}:
:($(Expr(:parameters, :($(Expr(:kw, :kw, 1))))))
:(x::Int)
in 1.9-
julia> ex = :(function (x::Int; kw=1) end)
:(function x::Int, #= REPL[1]:1 =#, kw = 1
#= REPL[1]:1 =#
#= REPL[1]:1 =#
end)
julia> ex.args[1].head
:block
julia> ex.args[1].args
3-element Vector{Any}:
:(x::Int)
:(#= REPL[1]:1 =#)
:(kw = 1)
I'm not sure we have somewhere to clarify what the AST should look like, ideally in some formal way, tbh This causes trouble for people working on macro
s quite often. Now with JuliaSyntax, it's probably easier to have a piece of doc for this? PS. I remember there was an issue about this somewhere, but I don't remember which one it is.
Moelf and Tortar
Metadata
Metadata
Assignees
Labels
needs newsA NEWS entry is required for this changeA NEWS entry is required for this changeparserLanguage parsing and surface syntaxLanguage parsing and surface syntax