Merge branch 'master' of http://repo.or.cz/r/msysgit into devel
[msysgit/historical-msysgit.git] / share / vim / vim58 / syntax / debcontrol.vim
blobd469d31cbe5ec8e0a1182a035032901d112194be
1 " Vim syntax file
2 " Language:     Debian control files
3 " Maintainer:   Wichert Akkerman <wakkerma@debian.org>
4 " Last Change:  30 April 2001
6 " Standard syntax initialization
7 if version < 600
8   syntax clear
9 elseif exists("b:current_syntax")
10   finish
11 endif
13 " Everything that is not explicitly matched by the rules below
14 syn match debcontrolElse "^.*$"
16 " Define some common expressions we can use later on
17 syn match debcontrolArchitecture contained "\(all\|any\|alpha\|arm\|hppa\|i386\|m68k\|mips\|mipsel\|powerpc\|sh\|sheb\|sparc\|hurd-i386\)"
18 syn match debcontrolName contained "[a-z][a-z0-9+-]*"
19 syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)"
20 syn match debcontrolSection contained "\(\(contrib\|non-free\)/\)\=\(admin\|base\|comm\|devel\|docs\|editors\|electronics\|games\|graphics\|hamradio\|interpreters\|libs\|mail\|math\|misc\|net\|news\|oldlibs\|otherosfs\|science\|shells\|sound\|tex\|text\|utils\|web\|x11\|debian-installer\)"
21 syn match debcontrolVariable contained "\${.\{-}}"
23 " An email address
24 syn match       debcontrolEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+"
25 syn match       debcontrolEmail "<.\{-}>"
27 " List of all legal keys
28 syn match debcontrolKey contained "^\(Source\|Package\|Section\|Priority\|Maintainer\|Build-Depends\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Architecture\|Description\|Bugs\|Origin\): *"
30 " Fields for which we do strict syntax checking
31 syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture oneline
32 syn region debcontrolStrictField start="^\(Package\|Source\)" end="$" contains=debcontrolKey,debcontrolName oneline
33 syn region debcontrolStrictField start="^Priority" end="$" contains=debcontrolKey,debcontrolPriority oneline
34 syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline
36 " Catch-all for the other legal fields
37 syn region debcontrolField start="^\(Maintainer\|Build-Depends\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Bugs\|Origin\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline
38 syn region debcontrolMultiField start="^\(Description\):" skip="^ " end="^$"me=s-1 end="^[^ ]"me=s-1 contains=debcontrolKey
40 " Associate our matches and regions with pretty colours
41 if version >= 508 || !exists("did_debcontrol_syn_inits")
42   if version < 508
43     let did_debcontrol_syn_inits = 1
44     command -nargs=+ HiLink hi link <args>
45   else
46     command -nargs=+ HiLink hi def link <args>
47   endif
49   HiLink debcontrolKey          Keyword
50   HiLink debcontrolField        Normal
51   HiLink debcontrolStrictField  Error
52   HiLink debcontrolMultiField   Normal
53   HiLink debcontrolArchitecture Normal
54   HiLink debcontrolName         Normal
55   HiLink debcontrolPriority     Normal
56   HiLink debcontrolSection      Normal
57   HiLink debcontrolVariable     Identifier
58   HiLink debcontrolEmail        Identifier
59   HiLink debcontrolElse         Special
61   delcommand HiLink
62 endif
64 let b:current_syntax = "debcontrol"
66 " vim: ts=8 sw=2