File tree Expand file tree Collapse file tree 6 files changed +62
-31
lines changed
Expand file tree Collapse file tree 6 files changed +62
-31
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11' SYNTAX TEST "source.vba" "numbers"
22
33Dim dec As Decimal
4+ ' ^^^^^^^ support.type.Decimal
45dec = 2.375 D
56' ^^^^^^ constant.numeric.decimal
67dec = 4.000
78' ^^^^^ constant.numeric.decimal
89
910Dim doub As Double
10- doub= 4.0 R
11- ' ^^^^ constant.numeric.decimal
11+ ' ^^^^^^ support.type.Double
12+ doub = 4.0 R
13+ ' ^^^^ constant.numeric.decimal
1214
1315Dim sing As Single
16+ ' ^^^^^^ support.type.Single
1417sing = 4.2 F
1518' ^^^^ constant.numeric.decimal
1619
1720Dim i As Integer
21+ ' ^^^^^^^ support.type.Integer
1822i = 123
1923' ^^^ constant.numeric.integer
2024i = 1 _000_000
Original file line number Diff line number Diff line change 1+ ' SYNTAX TEST "source.vba" "main syntax test"
2+
3+ Attribute VB_Name = "SyntaxTest"
4+ ' ^^^^^^^^^ keyword.Attribute.vba
5+
6+ Public Const FOO As Integer = 1
7+ ' ^^^^^^ storage.modifier.visibility
8+ ' ^^^^^ keyword.Const.vba
9+ ' ^^ keyword.As.vba
10+
11+ ' some comment
12+ ' ^^^^^^^^^^^^^^ comment.line.quote
13+
14+ Dim obj As Object
15+ ' ^^^ keyword.Dim.vba
16+ Set obj = Nothing
17+ ' ^^^ keyword.Set.vba
18+ ' ^^^^^^^ keyword.Nothing.vba
19+ Set obj = New Object
20+ ' ^^^ keyword.New.vba
Original file line number Diff line number Diff line change 1+ ' SYNTAX TEST "source.vba" "Sub, Function and anything related"
2+
3+ Private Sub doStuff (x As String )
4+ ' ^^^^^^^ storage.modifier.visibility
5+ ' ^^^ keyword.Sub.vba
6+ End Sub
7+ ' ^^^ keyword.End.vba
8+ ' ^^^ keyword.Sub.vba
9+
10+ Function foo () As Boolean
11+ ' ^^^^^^^^ keyword.Function.vba
12+ ' ^^ keyword.As.vba
13+ ' ^^^^^^^ support.type.Boolean
14+ End Function
15+ ' ^^^ keyword.End.vba
16+ ' ^^^^^^^^ keyword.Function.vba
17+
18+ Function withParam (Optional p1 As MyType )
19+ ' ^^^^^^^^ storage.modifier.visibility
20+ End Function
21+
22+ Call Mod .mSub ()
Original file line number Diff line number Diff line change 1+ ' SYNTAX TEST "source.vba" "Strings"
2+
3+ Dim str As String
4+ ' ^^^^^^ support.type.String
5+ str = "Hello"
6+ ' ^^^^^^^ string.quoted
Original file line number Diff line number Diff line change 1010 { "include" : " #keywords" },
1111 { "include" : " #numbers" },
1212 { "include" : " #option" },
13+ { "include" : " #strings" },
1314 { "include" : " #types" },
1415 { "include" : " #visibility" }
1516 ],
2324 "patterns" : [
2425 {
2526 "name" : " keyword.$1.vba" ,
26- "match" : " \\ b(As|Attribute|Function|Sub|End)\\ b"
27+ "match" : " \\ b(As|Attribute|Const|Dim| Function|New|Nothing|Set |Sub|End)\\ b"
2728 }
2829 ]
2930 },
4344 "name" : " storage.modifier.option" ,
4445 "match" : " \\ b(Option (Explicit|Private Module|Base|(Compare (Binary|Text)+))?)\\ b"
4546 },
47+ "strings" : {
48+ "name" : " string.quoted" ,
49+ "begin" : " \" " ,
50+ "end" : " \" "
51+ },
4652 "types" : {
4753 "name" : " support.type.$1" ,
4854 "match" : " \\ b(Boolean|Byte|Char|Date|Decimal|Double|Integer|Long|Object|SByte|Short|Single|String|UInteger|ULong|UShort)\\ b"
4955 },
5056 "visibility" : {
5157 "name" : " storage.modifier.visibility" ,
52- "match" : " \\ b(Public|Private)\\ b"
58+ "match" : " \\ b(Public|Private|Optional )\\ b"
5359 }
5460 }
5561}
You can’t perform that action at this time.
0 commit comments