asp.vb.net.tmbundle
asp.vb.net.tmbundle copied to clipboard
Wrong syntax colouring for the number 7 in Visual Basic
From @SeamusConacher on February 22, 2017 15:34
- VSCode Version: 1.9.1
- OS Version: Windows 10 Pro 1607
Steps to Reproduce:
- Declare a Dim or Const in Visual Basic with the Visual Basic syntax colouring
- Set it equal to any number that does not start with 7
- 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
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
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)
