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

Wrong syntax colouring for the number 7 in Visual Basic #7

Open
aeschli opened this issue Feb 23, 2017 · 2 comments
Open

Wrong syntax colouring for the number 7 in Visual Basic #7

aeschli opened this issue Feb 23, 2017 · 2 comments

Comments

@aeschli
Copy link

aeschli commented Feb 23, 2017

From @SeamusConacher on February 22, 2017 15:34

  • VSCode Version: 1.9.1
  • OS Version: Windows 10 Pro 1607

Steps to Reproduce:

  1. Declare a Dim or Const in Visual Basic with the Visual Basic syntax colouring
  2. Set it equal to any number that does not start with 7
  3. Set it equal to any number starting with 7

With any number starting with the number 7 the syntax colouring stays the variable colouring, rather than changing to the number colouring.

Copied from original issue: microsoft/vscode#21155

@msftrncs
Copy link

msftrncs commented May 15, 2019

With a subject like this, I'm intrigued, so here is my analysis.

<string>(?i:(dim)\s*(?:(\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b)\s*(,?)))</string>

@infininight, Isn't the Unicode 'hexadecimal escape' character pattern \xhh? The grammar is incorrectly accepting a 7 in the first character position because the pattern x7F-xFF needs to be \x7F-\xFF, but instead this matches x,7,f-x,f,f. This pattern seems to appear a lot in the grammar. Would you like me to post a PR to fix all of them?

/cc: @SeamusConacher

@RedCMD
Copy link

RedCMD commented Apr 16, 2022

I'm not sure what \x7F-\xFF corresponds to, but it doesn't seem to be extended-ascii or UTF 8
\x00-\x7F does however correspond to ASCII
Should probably use \x{7F}-\x{FF} instead as it corresponds to UTF 8
(in the context of vscodes json based textmate engine)
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants