Skip to content

Commit 32368aa

Browse files
committed
Enum properly supports comments and #If
1 parent cfaf152 commit 32368aa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

client/src/syntaxes/vba.tmLanguage.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ repository:
459459

460460
enum:
461461
name: meta.enum.declaration.vba
462-
begin: (?i)^\s*((?:(?:Public|Private)\s+)?\s*Enum)\s+([a-z][a-z0-9_]+)(\s+(?:'|Rem).*)
462+
begin: (?i)^\s*((?:(?:Public|Private)\s+)?\s*Enum)\s+([a-z][a-z0-9_]+)(\s+(?:'|Rem).*)?
463463
beginCaptures:
464464
1:
465465
name: storage.type.enum.vba
@@ -471,13 +471,17 @@ repository:
471471
patterns:
472472
- include: "#comment"
473473
- include: "#enumMember"
474-
end: (?i)^\s*End\s+Enum\b
474+
- include: "#language"
475+
end: (?i)^\s*(End\s+Enum)(\s+'.*)?
475476
endCaptures:
476-
0:
477+
1:
477478
name: storage.type.enum.vba
479+
2:
480+
patterns:
481+
- include: "#comments"
478482

479483
enumMember:
480-
match: (?i)^\s*([a-z][a-z0-9_]*)(?:\s+(=)\s+([^\n']*)\s+)?('.*)?$
484+
match: (?i)^\s*([a-z][a-z0-9_]*)(?:\s+(=)\s+([^\n']*))?(\s+(?:'|Rem).*)?
481485
captures:
482486
1:
483487
name: constant.numeric.enum.vba

0 commit comments

Comments
 (0)