diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
commit | 7a7f497b483cd65e340064f23ed1c73425ecba0a (patch) | |
tree | d5c99ea22a1e10300d06165f8ac96df6b0dc59e1 /runtime/syntax/dosbatch.vim | |
parent | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (diff) | |
parent | ade1b12f49c3b3914c74847d791eb90ea90b56b7 (diff) | |
download | rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.gz rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.bz2 rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpost
Diffstat (limited to 'runtime/syntax/dosbatch.vim')
-rw-r--r-- | runtime/syntax/dosbatch.vim | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/runtime/syntax/dosbatch.vim b/runtime/syntax/dosbatch.vim index a75771bd2d..55601996ad 100644 --- a/runtime/syntax/dosbatch.vim +++ b/runtime/syntax/dosbatch.vim @@ -2,11 +2,11 @@ " Language: MS-DOS/Windows batch file (with NT command extensions) " Maintainer: Mike Williams <mrmrdubya@gmail.com> " Filenames: *.bat -" Last Change: 12th February 2023 +" Last Change: 3rd February 2024 " " Options Flags: " dosbatch_cmdextversion - 1 = Windows NT, 2 = Windows 2000 [default] -" dosbatch_colons_comment - any value to treat :: as comment line +" dosbatch_colons_comment - any value to allow :: comments in code blocks " " quit when a syntax file was already loaded @@ -88,18 +88,22 @@ syn match dosbatchLabel "\<goto\s\+\h\w*\>"lc=4 syn match dosbatchLabel ":\h\w*\>" " Comments - usual rem but also two colons as first non-space is an idiom -syn match dosbatchComment "^rem\($\|\s.*$\)"lc=3 contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell -syn match dosbatchComment "^@rem\($\|\s.*$\)"lc=4 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell -syn match dosbatchComment "\srem\($\|\s.*$\)"lc=4 contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell -syn match dosbatchComment "\s@rem\($\|\s.*$\)"lc=5 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell +syn match dosbatchRemComment "^rem\($\|\s.*$\)"lc=3 contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell +syn match dosbatchRemComment "^@rem\($\|\s.*$\)"lc=4 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell +syn match dosbatchRemComment "\srem\($\|\s.*$\)"lc=4 contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell +syn match dosbatchRemComment "\s@rem\($\|\s.*$\)"lc=5 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell +syn match dosbatchColonComment "\s*:\s*:.*$" contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell + +" Commands code blocks +syn cluster dosbatchCodeBlockComment contains=dosbatchRemComment if exists("dosbatch_colons_comment") - syn match dosbatchComment "\s*:\s*:.*$" contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell + syn cluster dosbatchCodeBlockComment add=dosbatchColonComment else - syn match dosbatchError "\s*:\s*:.*$" + syn match dosbatchColonCommentErr contained "\s*:\s*:.*$" endif - -" Comments in ()'s - still to handle spaces before rem -syn match dosbatchComment "(rem\([^)]\|\^\@<=)\)*"lc=4 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell +syn match dosbatchColonCommentErr contained "\s*:\s*:[^)]*\(\(\n\s*\)\?)\)\@=" +syn region dosbatchCodeBlock transparent start=+(+ end=+)+ contains=dosbatchString,dosbatchVariable,dosBatchArgument,@dosbatchNumber,dosbatchImplicit,dosbatchStatement,dosbatchConditional,dosbatchRepeat,dosbatchOperator,@dosbatchCodeBlockComment,dosbatchColonCommentErr,dosbatchCodeBlock +syn match dosbatchCodeBlockErr ")" syn keyword dosbatchImplicit append assoc at attrib break cacls cd chcp chdir syn keyword dosbatchImplicit chkdsk chkntfs cls cmd color comp compact convert copy @@ -116,6 +120,8 @@ syn keyword dosbatchImplicit vol xcopy hi def link dosbatchTodo Todo hi def link dosbatchError Error +hi def link dosbatchCodeBlockErr dosbatchError +hi def link dosbatchColonCommentErr dosbatchError hi def link dosbatchStatement Statement hi def link dosbatchCommands dosbatchStatement @@ -140,6 +146,9 @@ hi def link dosbatchBinary dosbatchNumber hi def link dosbatchOctal dosbatchNumber hi def link dosbatchComment Comment +hi def link dosbatchRemComment dosbatchComment +hi def link dosbatchColonComment dosbatchComment + hi def link dosbatchImplicit Function hi def link dosbatchSwitch Special |