Mercurial > vim
annotate runtime/syntax/debcontrol.vim @ 3099:887d6d91882e
Updated a few runtime files.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 21 Sep 2011 19:22:10 +0200 |
parents | fd09a9c8468e |
children | 1b584a6f446c |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2152 | 2 " Language: Debian control files |
857 | 3 " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> |
4 " Former Maintainers: Gerfried Fuchs <alfie@ist.org> | |
5 " Wichert Akkerman <wakkerma@debian.org> | |
3099
887d6d91882e
Updated a few runtime files.
Bram Moolenaar <bram@vim.org>
parents:
2908
diff
changeset
|
6 " Last Change: 2011 Sep 17 |
2908 | 7 " URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debcontrol.vim |
7 | 8 |
9 " Standard syntax initialization | |
10 if version < 600 | |
11 syntax clear | |
12 elseif exists("b:current_syntax") | |
13 finish | |
14 endif | |
15 | |
1624 | 16 " Should match case except for the keys of each field |
17 syn case match | |
18 | |
7 | 19 " Everything that is not explicitly matched by the rules below |
20 syn match debcontrolElse "^.*$" | |
21 | |
22 " Common seperators | |
23 syn match debControlComma ", *" | |
24 syn match debControlSpace " " | |
25 | |
26 " Define some common expressions we can use later on | |
3099
887d6d91882e
Updated a few runtime files.
Bram Moolenaar <bram@vim.org>
parents:
2908
diff
changeset
|
27 syn match debcontrolArchitecture contained "\%(all\|linux-any\|\%(any-\)\=\%(alpha\|amd64\|arm\%(e[bl]\|hf\)\=\|avr32\|hppa\|i386\|ia64\|lpia\|m32r\|m68k\|mips\%(el\)\=\|powerpc\|ppc64\|s390x\=\|sh[34]\(eb\)\=\|sh\|sparc\%(64\)\=\)\|hurd-\%(i386\|any\)\|kfreebsd-\%(i386\|amd64\|any\)\|knetbsd-\%(i386\|any\)\|kopensolaris-\%(i386\|any\)\|netbsd-\%(alpha\|i386\|any\)\|any\)" |
2908 | 28 syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)" |
1624 | 29 syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+" |
7 | 30 syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)" |
2625 | 31 syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|java|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)" |
1624 | 32 syn match debcontrolPackageType contained "u\?deb" |
7 | 33 syn match debcontrolVariable contained "\${.\{-}}" |
1668 | 34 syn match debcontrolDmUpload contained "\cyes" |
7 | 35 |
1624 | 36 " A URL (using the domain name definitions from RFC 1034 and 1738), right now |
37 " only enforce protocol and some sanity on the server/path part; | |
38 syn match debcontrolHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" | |
39 syn match debcontrolVcsSvn contained "\vsvn%(\+ssh)?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" | |
40 syn match debcontrolVcsCvs contained "\v%(\-d *)?:pserver:[^@]+\@[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?:/[^[:space:]]*%( [^[:space:]]+)?$" | |
2034 | 41 syn match debcontrolVcsGit contained "\v%(git|http)://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" |
1624 | 42 |
7 | 43 " An email address |
44 syn match debcontrolEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+" | |
45 syn match debcontrolEmail "<.\{-}>" | |
46 | |
1624 | 47 " #-Comments |
48 syn match debcontrolComment "^#.*$" | |
49 | |
50 syn case ignore | |
51 | |
7 | 52 " List of all legal keys |
2908 | 53 syn match debcontrolKey contained "^\%(Source\|Package\|Section\|Priority\|\%(XSBC-Original-\)\=Maintainer\|Uploaders\|Build-\%(Conflicts\|Depends\)\%(-Indep\)\=\|Standards-Version\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Essential\|Architecture\|Multi-Arch\|Description\|Bugs\|Origin\|X[SB]-Python-Version\|Homepage\|\(XS-\)\=Vcs-\(Browser\|Arch\|Bzr\|Cvs\|Darcs\|Git\|Hg\|Mtn\|Svn\)\|\%(XC-\)\=Package-Type\|\%(XS-\)\=DM-Upload-Allowed\): *" |
7 | 54 |
55 " Fields for which we do strict syntax checking | |
56 syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture,debcontrolSpace oneline | |
2908 | 57 syn region debcontrolStrictField start="^Multi-Arch" end="$" contains=debcontrolKey,debcontrolMultiArch oneline |
7 | 58 syn region debcontrolStrictField start="^\(Package\|Source\)" end="$" contains=debcontrolKey,debcontrolName oneline |
59 syn region debcontrolStrictField start="^Priority" end="$" contains=debcontrolKey,debcontrolPriority oneline | |
60 syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline | |
2908 | 61 syn region debcontrolStrictField start="^\%(XC-\)\=Package-Type" end="$" contains=debcontrolKey,debcontrolPackageType oneline |
1624 | 62 syn region debcontrolStrictField start="^Homepage" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline keepend |
2034 | 63 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-\%(Browser\|Arch\|Bzr\|Darcs\|Hg\)" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline keepend |
64 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Svn" end="$" contains=debcontrolKey,debcontrolVcsSvn,debcontrolHTTPUrl oneline keepend | |
65 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Cvs" end="$" contains=debcontrolKey,debcontrolVcsCvs oneline keepend | |
66 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Git" end="$" contains=debcontrolKey,debcontrolVcsGit oneline keepend | |
67 syn region debcontrolStrictField start="^\%(XS-\)\=DM-Upload-Allowed" end="$" contains=debcontrolKey,debcontrolDmUpload oneline | |
7 | 68 |
69 " Catch-all for the other legal fields | |
2034 | 70 syn region debcontrolField start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Essential\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline |
2152 | 71 syn region debcontrolMultiField start="^\%(Build-\%(Conflicts\|Depends\)\%(-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Uploaders\|Description\):" skip="^ " end="^$"me=s-1 end="^[^ #]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment |
7 | 72 |
73 " Associate our matches and regions with pretty colours | |
74 if version >= 508 || !exists("did_debcontrol_syn_inits") | |
75 if version < 508 | |
76 let did_debcontrol_syn_inits = 1 | |
77 command -nargs=+ HiLink hi link <args> | |
78 else | |
79 command -nargs=+ HiLink hi def link <args> | |
80 endif | |
81 | |
82 HiLink debcontrolKey Keyword | |
83 HiLink debcontrolField Normal | |
84 HiLink debcontrolStrictField Error | |
85 HiLink debcontrolMultiField Normal | |
86 HiLink debcontrolArchitecture Normal | |
2908 | 87 HiLink debcontrolMultiArch Normal |
7 | 88 HiLink debcontrolName Normal |
89 HiLink debcontrolPriority Normal | |
90 HiLink debcontrolSection Normal | |
1624 | 91 HiLink debcontrolPackageType Normal |
7 | 92 HiLink debcontrolVariable Identifier |
93 HiLink debcontrolEmail Identifier | |
1624 | 94 HiLink debcontrolVcsSvn Identifier |
95 HiLink debcontrolVcsCvs Identifier | |
96 HiLink debcontrolVcsGit Identifier | |
97 HiLink debcontrolHTTPUrl Identifier | |
1668 | 98 HiLink debcontrolDmUpload Identifier |
1624 | 99 HiLink debcontrolComment Comment |
7 | 100 HiLink debcontrolElse Special |
101 | |
102 delcommand HiLink | |
103 endif | |
104 | |
105 let b:current_syntax = "debcontrol" | |
106 | |
107 " vim: ts=8 sw=2 |