JuliaSyntax.jl icon indicating copy to clipboard operation
JuliaSyntax.jl copied to clipboard

Error message regression when missing `)`

Open LilithHafner opened this issue 10 months ago • 0 comments

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

LilithHafner avatar Aug 28 '23 23:08 LilithHafner