diff --git a/Batch File/Batch File.sublime-syntax b/Batch File/Batch File.sublime-syntax index c2bc3c1508b..9e56cfc4697 100644 --- a/Batch File/Batch File.sublime-syntax +++ b/Batch File/Batch File.sublime-syntax @@ -161,7 +161,7 @@ contexts: comment-body: - meta_scope: comment.line.colon.dosbatch - include: line-continuations - - match: \n + - match: $\n? pop: 1 ignored-tail-inner: diff --git a/Batch File/tests/syntax_test_batch_file.bat b/Batch File/tests/syntax_test_batch_file.bat index 1628327dcd7..458148fcbc6 100644 --- a/Batch File/tests/syntax_test_batch_file.bat +++ b/Batch File/tests/syntax_test_batch_file.bat @@ -40,11 +40,11 @@ REM ^ I'm a (com|ment) ^ not a comment -:: ^^^^^^^^^^^^^ - comment +:: ^^^^^^^^^^^^^^ - comment REM not a comment -:: ^^^^^^^^^^^^^ - comment +:: ^^^^^^^^^^^^^^ - comment REM This follows a REM command :: <- keyword.declaration.rem.dosbatch - comment @@ -52,48 +52,113 @@ REM This follows a REM command REM This & and | echo "is commented out" ^ :: <- keyword.declaration.rem.dosbatch -:: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.command.rem.dosbatch comment.line.rem.dosbatch +:: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.command.rem.dosbatch comment.line.rem.dosbatch REM No line ^ continuation :: <- - comment -:: ^^^^^^^^^ - comment +:: ^^^^^^^^^^ - comment ::: Me too! :: ^^^ punctuation.definition.comment.dosbatch -:: ^^^^^^^^^^^ comment.line.colon.dosbatch +:: ^^^^^^^^^^^^ comment.line.colon.dosbatch + + ::: + Not me, though. +:: ^^^^^^^^^^^^^^^^ - comment :: Me too! :: ^^ punctuation.definition.comment.dosbatch -:: ^^^^^^^^^^ comment.line.colon.dosbatch +:: ^^^^^^^^^^^ comment.line.colon.dosbatch + + :: + Not me, though. +:: ^^^^^^^^^^^^^^^^ - comment :+ Me too! :: ^^ punctuation.definition.comment.dosbatch +:: ^^^^^^^^^^^ comment.line.colon.dosbatch + + :+ + Not me, though. +:: ^^^^^^^^^^^^^^^^ - comment := Me too! :: ^^ punctuation.definition.comment.dosbatch +:: ^^^^^^^^^^^ comment.line.colon.dosbatch + + := + Not me, though. +:: ^^^^^^^^^^^^^^^^ - comment :, Me too! :: ^^ punctuation.definition.comment.dosbatch +:: ^^^^^^^^^^^ comment.line.colon.dosbatch + + :, + Not me, though. +:: ^^^^^^^^^^^^^^^^ - comment :; Me too! :: ^^ punctuation.definition.comment.dosbatch +:: ^^^^^^^^^^^ comment.line.colon.dosbatch + + :; + Not me, though. +:: ^^^^^^^^^^^^^^^^ - comment : Me too! :: ^^ punctuation.definition.comment.dosbatch +:: ^^^^^^^^^^ comment.line.colon.dosbatch + + : + Not me, though. +:: ^^^^^^^^^^^^^^^^ - comment ::^ Me too! -:: ^^^^^^^ comment.line.colon.dosbatch +:: ^^^^^^^^ comment.line.colon.dosbatch + + ::^ + + Me too! +:: ^^^^^^^^ comment.line.colon.dosbatch + + ::^ + + + Not me, though. +:: ^^^^^^^^^^^^^^^^ - comment : ^ Me too! -:: ^^^^^^^ comment.line.colon.dosbatch +:: ^^^^^^^^ comment.line.colon.dosbatch + + : ^ + + Me too! +:: ^^^^^^^^ comment.line.colon.dosbatch + + : ^ + + + Not me, though. +:: ^^^^^^^^^^^^^^^^ - comment : ^ A continued comment.^ Me too! -:: ^^^^^^^ comment.line.colon.dosbatch +:: ^^^^^^^^ comment.line.colon.dosbatch + + : ^ + + Me too! +:: ^^^^^^^^ comment.line.colon.dosbatch + + : ^ +^ + Not me, though. +:: ^^^^^^^^^^^^^^^^ - comment :> ignored content ( & | ) :: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.colon.dosbatch @@ -114,30 +179,30 @@ continuation ECHO &&:: A comment :: ^^ keyword.operator.logical.dosbatch :: ^^ punctuation.definition.comment.dosbatch -:: ^^^^^^^^^^^^ comment.line.colon.dosbatch +:: ^^^^^^^^^^^^^ comment.line.colon.dosbatch ECHO &:: A comment :: ^ keyword.operator.logical.dosbatch :: ^^ punctuation.definition.comment.dosbatch -:: ^^^^^^^^^^^^ comment.line.colon.dosbatch +:: ^^^^^^^^^^^^^ comment.line.colon.dosbatch ECHO ||:: A comment :: ^^ keyword.operator.logical.dosbatch :: ^^ punctuation.definition.comment.dosbatch -:: ^^^^^^^^^^^^ comment.line.colon.dosbatch +:: ^^^^^^^^^^^^^ comment.line.colon.dosbatch ECHO |:: Not a comment :: ^ keyword.operator.assignment.pipe.dosbatch :: ^^^^^^^^^^^^^^^^ invalid.illegal.unexpected.dosbatch ECHO : Not a comment ^ -:: ^^^^^^^^^^^^^^^ - comment +:: ^^^^^^^^^^^^^^^^^^ - comment :: ^^ punctuation.separator.continuation.line.dosbatch ECHO : Not a comment ^ :: Me not, too :: <- - comment -::^^^^^^^^^^^^ - comment +::^^^^^^^^^^^^^ - comment :::: [ @ Operator ] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::