Skip to content

Commit eaedc42

Browse files
author
Lukas Neubert
committed
highlight unsigned number postfixes
fix #18
1 parent 080e222 commit eaedc42

File tree

3 files changed

+34
-11
lines changed

3 files changed

+34
-11
lines changed

syntaxes/tests/numbers.bas

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,40 @@ dec = 2.375D
77
dec = 4.000
88
' ^^^^^ constant.numeric.decimal
99

10-
Dim doub As Double
11-
' ^^^^^^ support.type.Double
12-
doub = 4.0R
13-
' ^^^^ constant.numeric.decimal
10+
Dim dub As Double
11+
' ^^^^^^ support.type.Double
12+
dub = 4.0R
13+
' ^^^^ constant.numeric.decimal
1414

15-
Dim sing As Single
16-
' ^^^^^^ support.type.Single
17-
sing = 4.2F
18-
' ^^^^ constant.numeric.decimal
15+
Dim sng As Single
16+
' ^^^^^^ support.type.Single
17+
sng = 4.2F
18+
' ^^^^ constant.numeric.decimal
1919

2020
Dim i As Integer
2121
' ^^^^^^^ support.type.Integer
2222
i = 123
2323
' ^^^ constant.numeric.integer
2424
i = 1_000_000
2525
' ^^^^^^^^^ constant.numeric.integer
26+
27+
Dim ui as UInteger
28+
' ^^^^^^^^ support.type.UInteger
29+
ui = 123ui
30+
' ^^^^^ constant.numeric.integer
31+
ui = 45_67UI
32+
' ^^^^^^^ constant.numeric.integer
33+
34+
Dim ul as ULong
35+
' ^^^^^ support.type.ULong
36+
ul = 123456ul
37+
' ^^^^^^^^ constant.numeric.integer
38+
ul = 123_456_789UL
39+
' ^^^^^^^^^^^^^ constant.numeric.integer
40+
41+
Dim us as UShort
42+
' ^^^^^^ support.type.UShort
43+
us = 1us
44+
' ^^^ constant.numeric.integer
45+
us = 1_2US
46+
' ^^^^^ constant.numeric.integer

syntaxes/tests/other.bas

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Attribute VB_Name = "SyntaxTest"
33
' <--------- keyword.Attribute.vba
44

5+
' Some comment
6+
' ^^^^^^^^^^^^^^ comment.line.quote
7+
58
Public Const FOO As Integer = 1
69
' <------ storage.modifier.visibility
710
' ^^^^^ keyword.Const.vba
@@ -20,8 +23,7 @@ With presentation
2023
For Each slide In .Slides
2124
' ^^^ keyword.control.For.vba
2225
' ^^^^ keyword.control.Each.vba
23-
Next ' Some comment
26+
Next
2427
' ^^^^ keyword.control.Next.vba
25-
' ^^^^^^^^^^^^^^ comment.line.quote
2628
End With
2729
' <-------- keyword.control.End.vba

syntaxes/vba.tmLanguage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
{
5050
"name": "constant.numeric.integer",
51-
"match": "(([0-9]+)([_]?))+"
51+
"match": "(([0-9]+)([_]?))+(ui|UI|ul|UL|us|US)?"
5252
}
5353
]
5454
},

0 commit comments

Comments
 (0)