-
Notifications
You must be signed in to change notification settings - Fork 29
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
In the translator, consider using gsub("%S", "") instead of gsub("%S", " ") #277
Comments
… " ")` Fixes issue #277. If we remove the non-whitespace characters instead of simply replacing them with spaces it produces a more pleasant-looking output. For example, ``` function f(x: integer) ``` becomes ``` function (x) ``` instead of ``` function f(x ) ``` Column numbers are not be preserved but line numbers are. This is okay because Lua error messages do not show column numbers, they only show line numbers.
… " ")` Fixes issue #277. If we remove the non-whitespace characters instead of simply replacing them with spaces it produces a more pleasant-looking output. For example, ``` function f(x: integer) ``` becomes ``` function (x) ``` instead of ``` function f(x ) ``` Column numbers are not be preserved but line numbers are. This is okay because Lua error messages do not show column numbers, they only show line numbers.
… " ")` Fixes issue #277. If we remove the non-whitespace characters instead of simply replacing them with spaces it produces a more pleasant-looking output. For example, ``` function f(x: integer) ``` becomes ``` function (x) ``` instead of ``` function f(x ) ``` Column numbers are not be preserved but line numbers are. This is okay because Lua error messages do not show column numbers, they only show line numbers.
… " ")` Fixes issue #277. If we remove the non-whitespace characters instead of simply replacing them with spaces it produces a more pleasant-looking output. For example, ``` function f(x: integer) ``` becomes ``` function (x) ``` instead of ``` function f(x ) ``` Column numbers are not be preserved but line numbers are. This is okay because Lua error messages do not show column numbers, they only show line numbers.
Fixed by #303. |
I was about to write an issue suggesting the original behavior, to get the column numbers. For “cheap” editor support, I am considering running Also, the fact that Lua itself doesn't show column numbers is perhaps an implementation detail that could change in the future? Anyway, in my opinion not much was won by removing the spaces, while potential for some tooling reuse was lost. If the more pleasant-looking output is important maybe keep |
Hmm, now that's an use case I something I hadn't thought about! I suppose that a command flag to tell pallenec to only type-check the program, without emitting a C or Lua file, might be helpful. I cooked up a quick one over on PR #566. Could you please check if it is useful for your purposes? As for the column numbers in --emit-lua, maybe it's useful if there are extra error messages you can get from luacheck but not from pallenec. Please feel free to experiment with it and create a PR if it turns out to be a good idea. (I do like the current pleasant-looking output though, so my vote is for a separate flag or configuration option). I only ask that if you do so, open a new issue instead of commenting on this one. It's easier for me to find the discussion if it's under a recent and open issue. |
If we remove the non-whitespace characters instead of simply replacing them with spaces it might produce more pleasant-looking output. For example,
could become
instead of
Column numbers would not be preserved but line numbers would still be preserved. I think this might be OK. IIRC, Lua error messages don't show column numbers, they only show line numbers.
The text was updated successfully, but these errors were encountered: