JuliaLang / JuliaSyntax.jl

The Julia compiler frontend
Other
274 stars 33 forks source link

Disallow tuples as atoms in interpolation syntax #305

Closed c42f closed 1 year ago

c42f commented 1 year ago

There's an error reporting inconsistency with the reference parser for commas in brackets in interpolations:

julia> JuliaSyntax.parsestmt(Expr, "\"\$(x, digits=1)\"")
:("$((x, digits = 1))")

julia> JuliaSyntax.fl_parse(Expr, "\"\$(x, digits=1)\"")
ERROR: ParseError("invalid interpolation syntax")
Stacktrace:
 [1] fl_parse(str::String, pos::Int64; greedy::Bool, raise::Bool, depwarn::Bool)
   @ JuliaSyntax ~/.julia/dev/JuliaSyntax/src/hooks.jl:379 [inlined]

Found in https://github.com/JuliaLang/julia/issues/18703#issuecomment-1583988716