Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax errors when forgetting an end are annoying to debug #48

Open
Dekkonot opened this issue Nov 26, 2019 · 2 comments
Open

Syntax errors when forgetting an end are annoying to debug #48

Dekkonot opened this issue Nov 26, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@Dekkonot
Copy link

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.

@Kampfkarren Kampfkarren added the bug Something isn't working label Nov 26, 2019
@zummenix
Copy link
Contributor

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'
   │

@Kampfkarren
Copy link
Owner

Yep--I think there's an issue outstanding for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants