Skip to content

Commit b7dad30

Browse files
committed
Fix comments for real this time.
1 parent 1b79b23 commit b7dad30

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

client/src/syntaxes/vba.tmLanguage.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ repository:
4141

4242
syntaxLines:
4343
name: meta.syntax-lines.vba
44-
match: ((?:[^\n":]|"(?:\\.|[^\n"\\])*")+|"(?:\\.|[^\n"\\])*")
44+
match: ((?:[^\n"':]|"(?:\\.|[^\n"\\])*")+|"(?:\\.|[^\n"\\])*")(?:('.*)*)?
4545
captures:
4646
1: # Split line
4747
patterns:
4848
- include: "#main"
49+
2: # Comments
50+
patterns:
51+
- include: "#comments"
4952

5053
main:
5154
patterns:
@@ -148,12 +151,11 @@ repository:
148151
repository:
149152
flowDecision:
150153
name: keyword.control.flow.decision.vba
151-
match: '(?i)(^|\s+)(#if|then|#elseif|#else|#end if|select case|case|switch|end select)\b'
152-
# match: '(?i)(^|\s+)([#]?if|then|[#]?elseif|[#]?else|[#]?end if|select case|case|switch|end select)\b'
154+
match: (?i)(^|\s+)(#if|then|#elseif|[#]?else|#end if|select case|case|switch|end select)\b
153155

154156
flowLoop:
155157
name: keyword.control.flow.loop.vba
156-
match: "(?i)\\b(do|exit\\s+do|while|until|loop|for|each|in|to|exit\\s+for|next|with)\\b"
158+
match: (?i)\b(do|exit\s+do|while|until|loop|for|each|in|to|exit\s+for|next|with)\b
157159

158160
forEachLoop:
159161
name: meta.flow.foreach.vba
@@ -170,7 +172,7 @@ repository:
170172

171173
inlineIfElse:
172174
name: meta.flow.inline-if-else.vba
173-
match: (?i)\b(if)\s+(.*?)\s+(then)\s+(.*)\s+(else)\s+(.*)
175+
match: (?i)\s*((?:else)?if)\s+(.*?)\s+(then)\s+(.*)\s+(else)\s+([^'\n]*)
174176
captures:
175177
1:
176178
name: keyword.control.flow.decision.vba
@@ -193,7 +195,7 @@ repository:
193195

194196
inlineIf:
195197
name: meta.flow.inline-if.vba
196-
match: (?i)\b(if)\s+(.*?)\s+(then)
198+
match: (?i)\s*((?:else)?if)\s+(.*?)\s+(then)
197199
captures:
198200
1:
199201
name: keyword.control.flow.decision.vba

0 commit comments

Comments
 (0)