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

[Issue]: yagChar is Not up to Spec #75

Open
1 task done
l-zeuch opened this issue Feb 20, 2023 · 0 comments
Open
1 task done

[Issue]: yagChar is Not up to Spec #75

l-zeuch opened this issue Feb 20, 2023 · 0 comments
Labels
area/syntax affecting syntax highlight editor/vim-neovim affecting both Neovim and Vim status/triage default label before it is marked as bug or something else
Milestone

Comments

@l-zeuch
Copy link
Owner

l-zeuch commented Feb 20, 2023

Expected Behaviour

According to the Go specification on Rune literals1, following sequences are allowed:

'a'
'ä'
'本'
'\t'
'\000'
'\007'
'\377'
'\x07'
'\xff'
'\u12e4'
'\U00101234'
'\''         // rune literal containing single quote character

Thus, it is expected that the yagChar syntax group also recognises those.

Actual Behaviour

Instead, we see the following behaviour:

2023-02-19-185502_248x109_scrot

Here, through some tricky code, we try to let the user know when they are creating/using an illegal rune literal. However, according to the Go specification1 the sequences in the above screenshot are actually valid, as I copied them directly from there.

Steps to Reproduce

  1. Go to the Go spec (https://go.dev/ref/spec#Rune_literals)
  2. copy any valid rune literal longer than two characters
  3. Insert to a *.yag file (or any accepted file extension)
  4. See screenshot

Additional Context

I understand that validating Unicode may be a hard task to do; if this seems unfeasible, we could just resort to finding the longest Unicode sequence available and use that as the maximum allowed.

If memory serves me right, Unicode ranges from 0 to 0x10FFFF, though not all are assigned. Perhaps we could call out to Python if we really want to validate any given Unicode sequence2, and maybe even display it as virtual text of sorts.345
(Given that the user's (Neo)Vim supports said virtual text)

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Footnotes

  1. https://go.dev/ref/spec#Rune_literals 2

  2. https://docs.python.org/3/howto/unicode.html

  3. https://neovim.io/doc/user/api.html#api-extmark

  4. https://vimhelp.org/textprop.txt.html

  5. https://vimhelp.org/textprop.txt.html#virtual-text

@l-zeuch l-zeuch added status/triage default label before it is marked as bug or something else area/syntax affecting syntax highlight editor/vim-neovim affecting both Neovim and Vim labels Feb 20, 2023
@l-zeuch l-zeuch added this to the Backlog milestone Feb 20, 2023
@l-zeuch l-zeuch self-assigned this Mar 27, 2023
@l-zeuch l-zeuch removed their assignment Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/syntax affecting syntax highlight editor/vim-neovim affecting both Neovim and Vim status/triage default label before it is marked as bug or something else
Projects
None yet
Development

No branches or pull requests

1 participant