Mercurial > vim
annotate runtime/syntax/dosbatch.vim @ 14335:d59bf91128ea v8.1.0183
patch 8.1.0183: Lua API changed, breaking the build
commit https://github.com/vim/vim/commit/174136713181a1d1460951d7a0392b16603f81bb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 14 20:49:42 2018 +0200
patch 8.1.0183: Lua API changed, breaking the build
Problem: Lua API changed, breaking the build.
Solution: Adjust prototype of lua_rawgeti(). (Ken Takata,
closes #3157, closes #3144)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 14 Jul 2018 21:00:05 +0200 |
parents | 46763b01cd9a |
children | 11b656e74444 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: MSDOS batch file (with NT command extensions) | |
3 " Maintainer: Mike Williams <mrw@eandem.co.uk> | |
4 " Filenames: *.bat | |
2034 | 5 " Last Change: 6th September 2009 |
7 | 6 " Web Page: http://www.eandem.co.uk/mrw/vim |
7 " | |
8 " Options Flags: | |
9 " dosbatch_cmdextversion - 1 = Windows NT, 2 = Windows 2000 [default] | |
10 " | |
11 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
12 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
13 if exists("b:current_syntax") |
7 | 14 finish |
15 endif | |
16 | |
17 " Set default highlighting to Win2k | |
18 if !exists("dosbatch_cmdextversion") | |
19 let dosbatch_cmdextversion = 2 | |
20 endif | |
21 | |
22 " DOS bat files are case insensitive but case preserving! | |
23 syn case ignore | |
24 | |
25 syn keyword dosbatchTodo contained TODO | |
26 | |
27 " Dosbat keywords | |
28 syn keyword dosbatchStatement goto call exit | |
29 syn keyword dosbatchConditional if else | |
30 syn keyword dosbatchRepeat for | |
31 | |
32 " Some operators - first lot are case sensitive! | |
33 syn case match | |
34 syn keyword dosbatchOperator EQU NEQ LSS LEQ GTR GEQ | |
35 syn case ignore | |
2034 | 36 syn match dosbatchOperator "\s[-+\*/%!~]\s" |
7 | 37 syn match dosbatchOperator "=" |
38 syn match dosbatchOperator "[-+\*/%]=" | |
39 syn match dosbatchOperator "\s\(&\||\|^\|<<\|>>\)=\=\s" | |
40 syn match dosbatchIfOperator "if\s\+\(\(not\)\=\s\+\)\=\(exist\|defined\|errorlevel\|cmdextversion\)\="lc=2 | |
41 | |
42 " String - using "'s is a convenience rather than a requirement outside of FOR | |
1623 | 43 syn match dosbatchString "\"[^"]*\"" contains=dosbatchVariable,dosBatchArgument,dosbatchSpecialChar,@dosbatchNumber,@Spell |
44 syn match dosbatchString "\<echo\([^)>|]\|\^\@<=[)>|]\)*"lc=4 contains=dosbatchVariable,dosbatchArgument,dosbatchSpecialChar,@dosbatchNumber,@Spell | |
7 | 45 syn match dosbatchEchoOperator "\<echo\s\+\(on\|off\)\s*$"lc=4 |
46 | |
47 " For embedded commands | |
48 syn match dosbatchCmd "(\s*'[^']*'"lc=1 contains=dosbatchString,dosbatchVariable,dosBatchArgument,@dosbatchNumber,dosbatchImplicit,dosbatchStatement,dosbatchConditional,dosbatchRepeat,dosbatchOperator | |
49 | |
50 " Numbers - surround with ws to not include in dir and filenames | |
2034 | 51 syn match dosbatchInteger "[[:space:]=(/:,!~-]\d\+"lc=1 |
52 syn match dosbatchHex "[[:space:]=(/:,!~-]0x\x\+"lc=1 | |
53 syn match dosbatchBinary "[[:space:]=(/:,!~-]0b[01]\+"lc=1 | |
54 syn match dosbatchOctal "[[:space:]=(/:,!~-]0\o\+"lc=1 | |
7 | 55 syn cluster dosbatchNumber contains=dosbatchInteger,dosbatchHex,dosbatchBinary,dosbatchOctal |
56 | |
57 " Command line switches | |
58 syn match dosbatchSwitch "/\(\a\+\|?\)" | |
59 | |
60 " Various special escaped char formats | |
61 syn match dosbatchSpecialChar "\^[&|()<>^]" | |
62 syn match dosbatchSpecialChar "\$[a-hl-npqstv_$+]" | |
63 syn match dosbatchSpecialChar "%%" | |
64 | |
65 " Environment variables | |
66 syn match dosbatchIdentifier contained "\s\h\w*\>" | |
67 syn match dosbatchVariable "%\h\w*%" | |
68 syn match dosbatchVariable "%\h\w*:\*\=[^=]*=[^%]*%" | |
2034 | 69 syn match dosbatchVariable "%\h\w*:\~[-]\=\d\+\(,[-]\=\d\+\)\=%" contains=dosbatchInteger |
7 | 70 syn match dosbatchVariable "!\h\w*!" |
2034 | 71 syn match dosbatchVariable "!\h\w*:\*\=[^=]*=[^!]*!" |
72 syn match dosbatchVariable "!\h\w*:\~[-]\=\d\+\(,[-]\=\d\+\)\=!" contains=dosbatchInteger | |
7 | 73 syn match dosbatchSet "\s\h\w*[+-]\==\{-1}" contains=dosbatchIdentifier,dosbatchOperator |
74 | |
75 " Args to bat files and for loops, etc | |
76 syn match dosbatchArgument "%\(\d\|\*\)" | |
2034 | 77 syn match dosbatchArgument "%[a-z]\>" |
7 | 78 if dosbatch_cmdextversion == 1 |
79 syn match dosbatchArgument "%\~[fdpnxs]\+\(\($PATH:\)\=[a-z]\|\d\)\>" | |
80 else | |
81 syn match dosbatchArgument "%\~[fdpnxsatz]\+\(\($PATH:\)\=[a-z]\|\d\)\>" | |
82 endif | |
83 | |
84 " Line labels | |
85 syn match dosbatchLabel "^\s*:\s*\h\w*\>" | |
86 syn match dosbatchLabel "\<\(goto\|call\)\s\+:\h\w*\>"lc=4 | |
87 syn match dosbatchLabel "\<goto\s\+\h\w*\>"lc=4 | |
88 syn match dosbatchLabel ":\h\w*\>" | |
89 | |
90 " Comments - usual rem but also two colons as first non-space is an idiom | |
1623 | 91 syn match dosbatchComment "^rem\($\|\s.*$\)"lc=3 contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell |
2034 | 92 syn match dosbatchComment "^@rem\($\|\s.*$\)"lc=4 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell |
1623 | 93 syn match dosbatchComment "\srem\($\|\s.*$\)"lc=4 contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell |
2034 | 94 syn match dosbatchComment "\s@rem\($\|\s.*$\)"lc=5 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell |
1623 | 95 syn match dosbatchComment "\s*:\s*:.*$" contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell |
7 | 96 |
97 " Comments in ()'s - still to handle spaces before rem | |
1623 | 98 syn match dosbatchComment "(rem\([^)]\|\^\@<=)\)*"lc=4 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell |
7 | 99 |
100 syn keyword dosbatchImplicit append assoc at attrib break cacls cd chcp chdir | |
101 syn keyword dosbatchImplicit chkdsk chkntfs cls cmd color comp compact convert copy | |
102 syn keyword dosbatchImplicit date del dir diskcomp diskcopy doskey echo endlocal | |
103 syn keyword dosbatchImplicit erase fc find findstr format ftype | |
104 syn keyword dosbatchImplicit graftabl help keyb label md mkdir mode more move | |
105 syn keyword dosbatchImplicit path pause popd print prompt pushd rd recover rem | |
106 syn keyword dosbatchImplicit ren rename replace restore rmdir set setlocal shift | |
107 syn keyword dosbatchImplicit sort start subst time title tree type ver verify | |
108 syn keyword dosbatchImplicit vol xcopy | |
109 | |
110 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
111 " Only when an item doesn't have highlighting yet |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
112 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
113 hi def link dosbatchTodo Todo |
7 | 114 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
115 hi def link dosbatchStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
116 hi def link dosbatchCommands dosbatchStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
117 hi def link dosbatchLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
118 hi def link dosbatchConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
119 hi def link dosbatchRepeat Repeat |
7 | 120 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
121 hi def link dosbatchOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
122 hi def link dosbatchEchoOperator dosbatchOperator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
123 hi def link dosbatchIfOperator dosbatchOperator |
7 | 124 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
125 hi def link dosbatchArgument Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
126 hi def link dosbatchIdentifier Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
127 hi def link dosbatchVariable dosbatchIdentifier |
7 | 128 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
129 hi def link dosbatchSpecialChar SpecialChar |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
130 hi def link dosbatchString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
131 hi def link dosbatchNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
132 hi def link dosbatchInteger dosbatchNumber |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
133 hi def link dosbatchHex dosbatchNumber |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
134 hi def link dosbatchBinary dosbatchNumber |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
135 hi def link dosbatchOctal dosbatchNumber |
7 | 136 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
137 hi def link dosbatchComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
138 hi def link dosbatchImplicit Function |
7 | 139 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
140 hi def link dosbatchSwitch Special |
7 | 141 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
142 hi def link dosbatchCmd PreProc |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
143 |
7 | 144 |
145 let b:current_syntax = "dosbatch" | |
146 | |
147 " vim: ts=8 |