File tree Expand file tree Collapse file tree 3 files changed +54
-6
lines changed
Expand file tree Collapse file tree 3 files changed +54
-6
lines changed Original file line number Diff line number Diff line change 1+ ' SYNTAX TEST "source.vba" "test comment variations"
2+
3+ ' Some comment
4+ ' ^^^^^^^^^^^^^^ comment.line.quote
5+
6+ 10 ' Some comment with line number
7+ ' <-- constant.numeric.decimal
8+ ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.quote
9+
10+ Label1: ' Some comment with label
11+ ' ^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.quote
12+
13+ Dim x as Long 'Some comment at the end of a line
14+ ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.quote
15+
16+ Dim x As Long : 'Test comment with colon
17+ ' ^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.quote
18+
19+ Rem Some comment
20+ ' ^^^^^^^^^^^^^^^^ comment.line.rem
21+
22+ 10 Rem Some comment with line number
23+ ' <-- constant.numeric.decimal
24+ ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.rem
25+
26+ Label1: Rem Some comment with label
27+ ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.rem
28+
29+ Dim x as Long Rem Some comment at the end of a line
30+ ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - comment.line.rem
31+
32+ Dim x As Long : Rem Test comment with colon
33+ ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.rem
34+
35+ ' multi line _
36+ comment
37+ ' ^^^^^^^ comment.line.continuation
38+
39+ Rem multi line _
40+ comment
41+ ' ^^^^^^^ comment.line.continuation
42+
Original file line number Diff line number Diff line change 33Attribute VB_Name = "SyntaxTest"
44' <--------- keyword.other.vba
55
6- ' Some comment
7- ' ^^^^^^^^^^^^^^ comment.line.quote
8-
96Public Const FOO As Integer = 1
107' ^^^^^ keyword.other.vba
118' ^^ keyword.control.vba
Original file line number Diff line number Diff line change @@ -22,9 +22,18 @@ patterns:
2222
2323repository :
2424 comments :
25- name : comment.line.quote
26- begin : " '"
27- end : $
25+ begin : " (?=')|(?:^(?:|(\\ d*)\\ s*|[a-zA-Z][a-zA-Z0-9]{0,254}:\\ s*)|:\\ s*)(?=(?i:Rem ))"
26+ beginCaptures :
27+ ' 1 ' :
28+ name : constant.numeric.decimal
29+ end : " (?<!\\ s_)$\n "
30+ patterns :
31+ - name : comment.line.quote
32+ match : " '.*"
33+ - name : comment.line.rem
34+ match : Rem .*
35+ - name : comment.line.continuation
36+ match : " ^.*"
2837
2938 keywords :
3039 patterns :
You can’t perform that action at this time.
0 commit comments