Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client/src/syntaxes/vba.tmLanguage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,15 @@ repository:

comments:
patterns:
- include: "#remarkComments"
- include: "#blockComments"
- include: "#apostropheComments"
- include: "#remarkComments"
repository:
blockComments:
# The sub-pattern consumes the \n if preceded by line continuation.
# Capturing it there prevents the end pattern being matched.
name: comment.block.vba
begin: (?i)\s*'.*\s_\s*
begin: (?i)(\s*'|(?<=^\d*?|:)\s*Rem\b).*\s_\s*
end: \n
patterns:
- include: "#lineContinuation"
Expand All @@ -432,7 +432,7 @@ repository:
match: (?i)\s*'.*
remarkComments:
name: comment.line.remark.vba
match: (?i)(?<=^|:)\s*Rem\b.*
match: (?i)(?<=^\d*?|:)\s*Rem\b.*

attribute:
name: meta.attribute.vba
Expand Down
63 changes: 63 additions & 0 deletions test/textmate/unit/module/comments.vba
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
' SYNTAX TEST "source.vba" "comments"

' This is a comment with without indentation
' <-------------------------------------------- comment.line.apostrophe.vba

' This is a comment with indentation
' ^^^^^^^^^^^^^^^^^^^ comment.line.apostrophe.vba

10 ' Comment with line number
' <-- constant.numeric.vba
' ^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.apostrophe.vba

Label1: ' Comment with label
' ^^^^^^^^^^^^^^^^^^^^ comment.line.apostrophe.vba

Dim x as Long 'Comment at the end of a line
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.apostrophe.vba

Dim x As Long: 'Comment with colon
' ^^^^^^^^^^^^^^^^^^^ comment.line.apostrophe.vba

' This is the start of a comment block _
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.vba

' This is a comment _
continued on the next line
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.vba

' This is a comment _
continued on the next line _
and another line
' ^^^^^^^^^^^^^^^^ comment.block.vba

Rem This is a remark without indentation
' <-------------------------------------- comment.line.remark.vba

Rem This is a remark with indentation
' ^^^^^^^^^^^^^^^^^^^^ comment.line.remark.vba

10 Rem Comment with line number
' <-- constant.numeric.vba
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.remark.vba

Label1: Rem Comment with label
' ^^^^^^^^^^^^^^^^^^^^^^ comment.line.remark.vba

Dim x as Long Rem Comment at the end of a line
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - comment.line.remark.vba

Dim x As Long: Rem Comment with colon
' ^^^^^^^^^^^^^^^^^^^^^^ comment.line.remark.vba

Rem This is the start of a comment block _
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.vba

Rem This is a comment _
continued on the next line
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.vba

Rem This is a comment _
continued on the next line _
and another line
' ^^^^^^^^^^^^^^^^ comment.block.vba
Loading