Skip to content

Commit

Permalink
VB: Added support for comments with line continuations (#2195)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored Feb 4, 2020
1 parent 3b42536 commit a7d67ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions components/prism-visual-basic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Prism.languages['visual-basic'] = {
'comment': {
pattern: /(?:['‘’]|REM\b).*/i,
pattern: /(?:['‘’]|REM\b)(?:[^\r\n_]|_(?:\r\n?|\n)?)*/i,
inside: {
'keyword': /^REM/i
}
Expand Down Expand Up @@ -31,4 +31,4 @@ Prism.languages['visual-basic'] = {
'punctuation': /[{}().,:?]/
};

Prism.languages.vb = Prism.languages['visual-basic'];
Prism.languages.vb = Prism.languages['visual-basic'];
2 changes: 1 addition & 1 deletion components/prism-visual-basic.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions tests/languages/visual-basic/comment_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
REM
REM Foobar

' multi-line _
comment

----------------------------------------------------

[
Expand All @@ -17,9 +20,10 @@ REM Foobar
["comment", ["’"]],
["comment", ["’ Foobar"]],
["comment", [["keyword", "REM"]]],
["comment", [["keyword", "REM"], " Foobar"]]
["comment", [["keyword", "REM"], " Foobar"]],
["comment", ["' multi-line _\r\n comment"]]
]

----------------------------------------------------

Checks for comments.
Checks for comments.

0 comments on commit a7d67ca

Please sign in to comment.