Skip to content

Commit 860a39e

Browse files
author
Lukas Neubert
committed
syntax: Option ...
fix #9
1 parent 6c6cf73 commit 860a39e

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

syntaxes/tests/main.bas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
' SYNTAX TEST "source.vba" "main syntax test"
22

33
Public Const FOO As Int = 1
4-
' ^^^^^^ storage.visibility
4+
' ^^^^^^ storage.modifier.visibility
55

66
' some comment
77
' ^^^^^^^^^^^^^^ comment.line
88

99
Private Sub doStuff()
10-
' ^^^^^^^ storage.visibility
10+
' ^^^^^^^ storage.modifier.visibility
1111
End Sub

syntaxes/tests/option.bas

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
' SYNTAX TEST "source.vba" "Option statement"
2+
3+
Option Explicit
4+
' ^^^^^^^^^^^^^^^ storage.modifier.option
5+
6+
Option Private Module
7+
' ^^^^^^^^^^^^^^^^^^^^^ storage.modifier.option
8+
9+
Option Compare Binary
10+
' ^^^^^^^^^^^^^^^^^^^^^ storage.modifier.option
11+
Option Compare Text
12+
' ^^^^^^^^^^^^^^^^^^^ storage.modifier.option
13+
14+
Option Base 1
15+
' ^^^^^^^^^^^ storage.modifier.option

syntaxes/vba.tmLanguage.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@
77
],
88
"patterns": [
99
{ "include": "#comments" },
10-
{ "include": "#storage" }
10+
{ "include": "#visibility" },
11+
{ "include": "#option" }
1112
],
1213
"repository": {
1314
"comments": {
1415
"name": "comment.line",
1516
"begin": "'",
1617
"end": "$"
1718
},
18-
"storage": {
19-
"name": "storage.visibility",
19+
"visibility": {
20+
"name": "storage.modifier.visibility",
2021
"match": "\\b(Public|Private)\\b"
22+
},
23+
"option": {
24+
"name": "storage.modifier.option",
25+
"match": "Option (Explicit|Private Module|Base|(Compare (Binary|Text)+))?"
2126
}
2227
}
2328
}

0 commit comments

Comments
 (0)