JuliaLang / JuliaSyntax.jl

The Julia compiler frontend
Other
272 stars 35 forks source link

Error message regression when missing `)` #348

Open LilithHafner opened 1 year ago

LilithHafner commented 1 year ago

I'm missing a ), but the new error message doesn't make that as clear as the old one.

Julia 1.0

julia> quote
           const $(esc(Symbol(name)) = 4
           export $(esc(Symbol(name))
       end
ERROR: syntax: missing comma or ) in argument list

Julia 1.10

julia> quote
           const $(esc(Symbol(name)) = 4
           export $(esc(Symbol(name))
       end
ERROR: ParseError:
# Error @ REPL[10]:2:5
quote
#   ┌────────────────────────────
    const $(esc(Symbol(name)) = 4
    export $(esc(Symbol(name))
#───────────────────────────┘ ── expected assignment after `const`
# Error @ REPL[10]:3:5
    const $(esc(Symbol(name)) = 4
    export $(esc(Symbol(name))
#   └──────────────────────┘ ── Expected `)`
# Error @ REPL[10]:3:30
    const $(esc(Symbol(name)) = 4
    export $(esc(Symbol(name))
#                            └ ── Expected `end`
# Error @ REPL[10]:3:30
    const $(esc(Symbol(name)) = 4
    export $(esc(Symbol(name))
#                            ╙ ── extra tokens after end of expression
# Error @ REPL[10]:4:1
    export $(esc(Symbol(name))
end
└─┘ ── invalid identifier
Stacktrace:
 [1] top-level scope
   @ none:1