full-moon
full-moon copied to clipboard
Syntax errors when forgetting an end are annoying to debug
In the case that you forget an end
somewhere in a Lua file, the error emitted by Full Moon makes it difficult to diagnose where the end
should have been. It will say that it encountered an "unexpected token ``" at the end of the file and then list the expected token (an end
), without specifying where the end is expected from. For files that are hundreds or potentially thousands of lines long, this can be problematic for what should hopefully be obvious reasons.
Is this mostly selene
issue?
For:
function add(a, b)
return a + b
selene (version 0.8.0) reports:
error[parse_error]: unexpected token ``
┌── /Users/zummenix/projects/full-moon/full-moon/tests/cases/fail/parser/missing-end/source.lua:4:1 ───
│
4 │
│ ^ expected 'end'
│
Yep--I think there's an issue outstanding for it.