-
Notifications
You must be signed in to change notification settings - Fork 191
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
Feature: keep line number when compiling #312
Comments
What we can do further is to trimmer unnecessary spaces. |
I think people prefer to have readable code than compressed code. If we were going to compress the code, then we might as well compress it as much as possible. What's the use case for trying to keep the line numbers? Having stack trace errors that work without rewriting? |
Exactly. Current version cannot rewrite traceback in luajit correctly, in my case, love2d. |
Usually it's not hard to work out the trace from the Lua back to MoonScript.. that said, it would be nice if error messages were more traceable.. but I also like having fairly readable output. Perhaps a command-line switch to compile in a mode that preserves line numbers? @buckle2000 This might not do what you want though. Sometimes errors in the output Lua aren't so easily traced, and doing things this way would actually make it more difficult to trace because of the loss in readability... |
You are right. It is not hard to find corresponding moonscript from Lua but it's annoying since most bugs are caused by writing mistakes, not logical mistakes, missing comma for example. Given the line number, these bugs can be easily fixed. |
As an FYI, I have been using buckle's branch and having the correct lines in development so far has been really helpful! |
@OttoRobba Thanks for your proof of concept! |
@leafo Is it possible to display correct error messages when using moonscript and love2d? Having to read compiled lua code to debug is not fun at all. |
@sherjilozair |
Is there any chance of this ever being merged? It'd make debugging errors far easier as often I find myself with an error on a line that doesn't even exist in the source. |
Since lua is whitespace-insentitive, why not just squeeze code together?
Probably working fork
Will close #311.
The text was updated successfully, but these errors were encountered: