JuliaLang / JuliaSyntax.jl

The Julia compiler frontend
Other
274 stars 33 forks source link

better error message for missing comma. #313

Closed oscardssmith closed 11 months ago

oscardssmith commented 1 year ago

When missing a , in a list or function args, the error message currently says "expected )" when the real problem is the missing comma. Should the error message be updated to add that as a possibility? (examples where this comes up are +(1, 2 3) and [1, 2 3])

c42f commented 1 year ago

We should be able to do better here :+1:

We could probably emit "expected , or closing )" easily.

Distinguishing between possible recoveries and choosing the "best" one is a lot harder.