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

Form feed \f and vertical tab \v are parsed incorrectly #1493

Closed
Janfel opened this issue Aug 23, 2022 · 0 comments
Closed

Form feed \f and vertical tab \v are parsed incorrectly #1493

Janfel opened this issue Aug 23, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Janfel
Copy link

Janfel commented Aug 23, 2022

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Linux

What is the issue affecting?

Diagnostics/Syntax Checking, Formatting

Expected Behaviour

The form feed (\f/^L) and vertical tab (\v/^K) characters are parsed as whitespace and do not cause unexpect-symbol syntax errors. This is consistent with PUC-Rio Lua as well as Luajit.

Form feed characters in particular also should not be removed by the code formatter and should ideally be indented to the beginning of the line. This way they can be used to delimit sections in Vim and Emacs.

Actual Behaviour

Form feed and vertical tab characters outside of comments cause unexpect-symbol syntax errors. They are removed from the ends of lines when formatting, both in code and in comments.

Reproduction steps

  1. Open a Lua source file.
  2. Insert ^L or ^K.
  3. See error 'Unexpected Symbol'.
  4. Run the formatter.
  5. ^L and ^K at the end of a line are removed.

Additional Notes

From the Lua 5.1 Reference Manual Section 5.4.1:

The definitions of letter, space, and other character groups depend on the current locale.

From man 3 isspace:

In the "C" and "POSIX" locales, these are: space, form-feed (\f), newline (\n), carriage return (\r), horizontal tab (\t), and vertical tab (\v).

Log File

No response

@sumneko sumneko added the bug Something isn't working label Aug 24, 2022
@sumneko sumneko closed this as completed in 436e23f Sep 6, 2022
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

2 participants