Skip to content

Commit 0285de5

Browse files
committed
fixed some keywords and added more
1 parent bcba0ff commit 0285de5

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

client/src/syntaxes/vba.tmLanguage.yaml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ repository:
8484
patterns:
8585
- include: "#kw-controlAs"
8686
- include: "#kw-flow"
87-
- include: "#kw-pauseExit"
8887
- include: "#kw-array"
8988
- include: "#kw-directives"
9089
repository:
@@ -94,12 +93,28 @@ repository:
9493

9594
kw-flow:
9695
patterns:
96+
- include: "#flowDecision"
9797
- include: "#flowLoop"
98+
- include: "#flowCall"
99+
- include: "#flowPauseExit"
98100
- include: "#flowBranch"
99101
repository:
102+
flowDecision:
103+
# TODO make block versions
104+
name: keyword.control.flow.decision.vba
105+
match: "(?i)\\b(if|then|elseif|else|end if|select case|case|switch|end select)\\b"
106+
100107
flowLoop:
101-
name: keyword.flow.loop.vba
102-
match: "(?i)\\b(do|while|until|loop|for|next|with|if|then|elseif|else|end)\\b"
108+
name: keyword.control.flow.loop.vba
109+
match: "(?i)\\b(do|exit\\s+do|while|until|loop|for|exit\\s+for|next|with)\\b"
110+
111+
flowCall:
112+
name: keyword.control.flow.call.vba
113+
match: "(?i)\\bcall\\b"
114+
115+
flowPauseExit:
116+
name: keyword.control.flow.other.vba
117+
match: "(?i)\\b(doevents|end|exit\\s+sub|exit\\s+function|exit\\s+property|stop)\\b"
103118

104119
flowBranch:
105120
patterns:
@@ -110,31 +125,27 @@ repository:
110125
match: "(?i)\\b(on\\s+error|on)\\s+(.*\\s+)?(goto|gosub)\\s+([a-z][a-z0-9_]*|\\d+)\\b"
111126
captures:
112127
1:
113-
name: keyword.flow.branch.vba
128+
name: keyword.control.flow.branch.vba
114129
2:
115130
patterns:
116131
- include: "#language"
117132
3:
118-
name: keyword.flow.branch.vba
133+
name: keyword.control.flow.branch.vba
119134
4:
120135
name: variable.other.constant.label.vba
121136

122137
flowBranchSimple:
123-
name: keyword.flow.branch.vba
138+
name: keyword.control.flow.branch.vba
124139
match: "(?i)\\b(gosub|return|goto)(?:\\s+([a-z][a-z0-9_]*|\\d+))?\\b"
125140
captures:
126141
1:
127-
name: keyword.flow.branch.vba
142+
name: keyword.control.flow.branch.vba
128143
2:
129144
name: variable.other.constant.label.vba
130145

131-
kw-pauseExit:
132-
name: "(?i)\\b(doevents|end|exit|stop)\\b"
133-
match: keyword.control.pause-exit.vba
134-
135146
kw-array:
136147
name: keyword.array.vba
137-
match: "(?i)\\b(isarray|array|redim|erase)\\b"
148+
match: "(?i)\\b(redim|erase)\\b"
138149

139150
kw-directives:
140151
patterns:

0 commit comments

Comments
 (0)