Mercurial > vim
comparison runtime/syntax/debcontrol.vim @ 12826:f690da1b3c04
Update runtime files.
commit https://github.com/vim/vim/commit/7f2e9d7c9cdfc5201a899b7b610edf64bf80c45f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 11 20:58:53 2017 +0100
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 11 Nov 2017 21:00:05 +0100 |
parents | 8d76a56861ec |
children | 167a030448fa |
comparison
equal
deleted
inserted
replaced
12825:4c1a7b0a6f5c | 12826:f690da1b3c04 |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: Debian control files | 2 " Language: Debian control files |
3 " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> | 3 " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> |
4 " Former Maintainers: Gerfried Fuchs <alfie@ist.org> | 4 " Former Maintainers: Gerfried Fuchs <alfie@ist.org> |
5 " Wichert Akkerman <wakkerma@debian.org> | 5 " Wichert Akkerman <wakkerma@debian.org> |
6 " Last Change: 2017 Aug 18 | 6 " Last Change: 2017 Nov 04 |
7 " URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debcontrol.vim | 7 " URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debcontrol.vim |
8 | 8 |
9 " Standard syntax initialization | 9 " Standard syntax initialization |
10 if exists("b:current_syntax") | 10 if exists("b:current_syntax") |
11 finish | 11 finish |
15 set cpo&vim | 15 set cpo&vim |
16 | 16 |
17 " Should match case except for the keys of each field | 17 " Should match case except for the keys of each field |
18 syn case match | 18 syn case match |
19 | 19 |
20 syn iskeyword @,48-57,-,/ | |
21 | |
20 " Everything that is not explicitly matched by the rules below | 22 " Everything that is not explicitly matched by the rules below |
21 syn match debcontrolElse "^.*$" | 23 syn match debcontrolElse "^.*$" |
22 | 24 |
23 " Common seperators | 25 " Common seperators |
24 syn match debControlComma ",[ \t]*" | 26 syn match debControlComma ",[ \t]*" |
25 syn match debControlSpace "[ \t]" | 27 syn match debControlSpace "[ \t]" |
26 | 28 |
27 let s:kernels = '\%(linux\|hurd\|kfreebsd\|knetbsd\|kopensolaris\|netbsd\)' | 29 let s:kernels = ['linux', 'hurd', 'kfreebsd', 'knetbsd', 'kopensolaris', 'netbsd'] |
28 let s:archs = '\%(alpha\|amd64\|armeb\|armel\|armhf\|arm64\|avr32\|hppa\|i386' | 30 let s:archs = [ |
29 \ . '\|ia64\|lpia\|m32r\|m68k\|mipsel\|mips64el\|mips\|powerpcspe\|powerpc\|ppc64el' | 31 \ 'alpha', 'amd64', 'armeb', 'armel', 'armhf', 'arm64', 'avr32', 'hppa' |
30 \ . '\|ppc64\|s390x\|s390\|sh3eb\|sh3\|sh4eb\|sh4\|sh\|sparc64\|sparc\|x32\)' | 32 \, 'i386', 'ia64', 'lpia', 'm32r', 'm68k', 'mipsel', 'mips64el', 'mips' |
31 let s:pairs = 'hurd-i386\|kfreebsd-i386\|kfreebsd-amd64\|knetbsd-i386\|kopensolaris-i386\|netbsd-alpha\|netbsd-i386' | 33 \, 'powerpcspe', 'powerpc', 'ppc64el', 'ppc64', 's390x', 's390', 'sh3eb' |
34 \, 'sh3', 'sh4eb', 'sh4', 'sh', 'sparc64', 'sparc', 'x32' | |
35 \ ] | |
36 let s:pairs = [ | |
37 \ 'hurd-i386', 'kfreebsd-i386', 'kfreebsd-amd64', 'knetbsd-i386' | |
38 \, 'kopensolaris-i386', 'netbsd-alpha', 'netbsd-i386' | |
39 \ ] | |
32 | 40 |
33 " Define some common expressions we can use later on | 41 " Define some common expressions we can use later on |
34 exe 'syn match debcontrolArchitecture contained "\%(all\|'. s:kernels .'-any\|\%(any-\)\='. s:archs .'\|'. s:pairs .'\|any\)"' | 42 syn keyword debcontrolArchitecture contained all any |
43 exe 'syn keyword debcontrolArchitecture contained '. join(map(s:kernels, {k,v -> v .'-any'})) | |
44 exe 'syn keyword debcontrolArchitecture contained '. join(map(s:archs, {k,v -> 'any-'.v})) | |
45 exe 'syn keyword debcontrolArchitecture contained '. join(s:archs) | |
46 exe 'syn keyword debcontrolArchitecture contained '. join(s:pairs) | |
35 | 47 |
36 unlet s:kernels s:archs s:pairs | 48 unlet s:kernels s:archs s:pairs |
37 | 49 |
38 syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)" | 50 let s:sections = [ |
51 \ 'admin', 'cli-mono', 'comm', 'database', 'debian-installer', 'debug' | |
52 \, 'devel', 'doc', 'editors', 'education', 'electronics', 'embedded' | |
53 \, 'fonts', 'games', 'gnome', 'gnustep', 'gnu-r', 'golang', 'graphics' | |
54 \, 'hamradio', 'haskell', 'httpd', 'interpreters', 'introspection' | |
55 \, 'java', 'javascript', 'kde', 'kernel', 'libs', 'libdevel', 'lisp' | |
56 \, 'localization', 'mail', 'math', 'metapackages', 'misc', 'net' | |
57 \, 'news', 'ocaml', 'oldlibs', 'otherosfs', 'perl', 'php', 'python' | |
58 \, 'ruby', 'rust', 'science', 'shells', 'sound', 'text', 'tex' | |
59 \, 'utils', 'vcs', 'video', 'web', 'x11', 'xfce', 'zope' | |
60 \ ] | |
61 | |
62 syn keyword debcontrolMultiArch contained no foreign allowed same | |
39 syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+" | 63 syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+" |
40 syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)" | 64 syn keyword debcontrolPriority contained extra important optional required standard |
41 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|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java%(script)=|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|rust|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)" | 65 exe 'syn match debcontrolSection contained "\%(\%(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\|restricted\|universe\|multiverse\)/\)\=\%('.join(s:sections, '\|').'\)"' |
42 syn match debcontrolPackageType contained "u\?deb" | 66 syn keyword debcontrolPackageType contained udeb deb |
43 syn match debcontrolVariable contained "\${.\{-}}" | 67 syn match debcontrolVariable contained "\${.\{-}}" |
44 syn match debcontrolDmUpload contained "\cyes" | 68 syn keyword debcontrolDmUpload contained yes |
69 syn keyword debcontrolYesNo contained yes no | |
70 syn match debcontrolR3 contained "\<\%(no\|binary-targets\|[[:graph:]]\+/[[:graph:]]\+\%( \+[[:graph:]]\+/[[:graph:]]\+\)*\)\>" | |
71 | |
72 unlet s:sections | |
45 | 73 |
46 " A URL (using the domain name definitions from RFC 1034 and 1738), right now | 74 " A URL (using the domain name definitions from RFC 1034 and 1738), right now |
47 " only enforce protocol and some sanity on the server/path part; | 75 " only enforce protocol and some sanity on the server/path part; |
48 syn match debcontrolHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" | 76 syn match debcontrolHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" |
49 syn match debcontrolVcsSvn contained "\vsvn%(\+ssh)?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" | 77 syn match debcontrolVcsSvn contained "\vsvn%(\+ssh)?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" |
57 " #-Comments | 85 " #-Comments |
58 syn match debcontrolComment "^#.*$" contains=@Spell | 86 syn match debcontrolComment "^#.*$" contains=@Spell |
59 | 87 |
60 syn case ignore | 88 syn case ignore |
61 | 89 |
62 " List of all legal keys | 90 " List of all legal keys, in order, from deb-src-control(5) |
63 syn match debcontrolKey contained "^\%(Source\|Package\|Section\|Priority\|\%(XSBC-Original-\)\=Maintainer\|Uploaders\|Build-\%(Conflicts\|Depends\)\%(-Arch\|-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-\)\=Testsuite\): *" | 91 " Source fields |
92 syn match debcontrolKey contained "^\%(Source\|Maintainer\|Uploaders\|Standards-Version\|Description\|Homepage\|Bugs\|Rules-Requires-Root\): *" | |
93 syn match debcontrolKey contained "^\%(XS-\)\=Vcs-\%(Arch\|Bzr\|Cvs\|Darcs\|Git\|Hg\|Mtn\|Svn\|Browser\): *" | |
94 syn match debcontrolKey contained "^\%(Origin\|Section\|Priority\): *" | |
95 syn match debcontrolKey contained "^Build-\%(Depends\|Conflicts\)\%(-Arch\|-Indep\)\=: *" | |
96 | |
97 " Binary fields | |
98 syn match debcontrolKey contained "^\%(Package\%(-Type\)\=\|Architecture\|Build-Profiles\): *" | |
99 syn match debcontrolKey contained "^\%(\%(Build-\)\=Essential\|Multi-Arch\|Tag\): *" | |
100 syn match debcontrolKey contained "^\%(\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\): *" | |
101 syn match debcontrolKey contained "^\%(Subarchitecture\|Kernel-Version\|Installer-Menu-Item\): *" | |
102 | |
103 " User-defined fields | |
104 syn match debcontrolKey contained "^X[SBC]\{0,3\}\%(-Private\)\=-[-a-zA-Z0-9]\+: *" | |
64 | 105 |
65 syn match debcontrolDeprecatedKey contained "^\%(\%(XS-\)\=DM-Upload-Allowed\): *" | 106 syn match debcontrolDeprecatedKey contained "^\%(\%(XS-\)\=DM-Upload-Allowed\): *" |
66 | 107 |
67 " Fields for which we do strict syntax checking | 108 " Fields for which we do strict syntax checking |
68 syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture,debcontrolSpace oneline | 109 syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture,debcontrolSpace oneline |
69 syn region debcontrolStrictField start="^Multi-Arch" end="$" contains=debcontrolKey,debcontrolMultiArch oneline | 110 syn region debcontrolStrictField start="^Multi-Arch" end="$" contains=debcontrolKey,debcontrolMultiArch oneline |
70 syn region debcontrolStrictField start="^\(Package\|Source\)" end="$" contains=debcontrolKey,debcontrolName oneline | 111 syn region debcontrolStrictField start="^\%(Package\|Source\)" end="$" contains=debcontrolKey,debcontrolName oneline |
71 syn region debcontrolStrictField start="^Priority" end="$" contains=debcontrolKey,debcontrolPriority oneline | 112 syn region debcontrolStrictField start="^Priority" end="$" contains=debcontrolKey,debcontrolPriority oneline |
72 syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline | 113 syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline |
73 syn region debcontrolStrictField start="^\%(XC-\)\=Package-Type" end="$" contains=debcontrolKey,debcontrolPackageType oneline | 114 syn region debcontrolStrictField start="^\%(XC-\)\=Package-Type" end="$" contains=debcontrolKey,debcontrolPackageType oneline |
74 syn region debcontrolStrictField start="^Homepage" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline keepend | 115 syn region debcontrolStrictField start="^Homepage" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline keepend |
75 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-\%(Browser\|Arch\|Bzr\|Darcs\|Hg\)" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline keepend | 116 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-\%(Browser\|Arch\|Bzr\|Darcs\|Hg\)" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline keepend |
76 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Svn" end="$" contains=debcontrolKey,debcontrolVcsSvn,debcontrolHTTPUrl oneline keepend | 117 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Svn" end="$" contains=debcontrolKey,debcontrolVcsSvn,debcontrolHTTPUrl oneline keepend |
77 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Cvs" end="$" contains=debcontrolKey,debcontrolVcsCvs oneline keepend | 118 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Cvs" end="$" contains=debcontrolKey,debcontrolVcsCvs oneline keepend |
78 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Git" end="$" contains=debcontrolKey,debcontrolVcsGit oneline keepend | 119 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Git" end="$" contains=debcontrolKey,debcontrolVcsGit oneline keepend |
79 syn region debcontrolStrictField start="^\%(XS-\)\=DM-Upload-Allowed" end="$" contains=debcontrolDeprecatedKey,debcontrolDmUpload oneline | 120 syn region debcontrolStrictField start="^\%(XS-\)\=DM-Upload-Allowed" end="$" contains=debcontrolDeprecatedKey,debcontrolDmUpload oneline |
121 syn region debcontrolStrictField start="^Rules-Requires-Root" end="$" contains=debcontrolKey,debcontrolR3 oneline | |
122 syn region debcontrolStrictField start="^\%(Build-\)\=Essential" end="$" contains=debcontrolKey,debcontrolYesNo oneline | |
80 | 123 |
81 " Catch-all for the other legal fields | 124 " Catch-all for the other legal fields |
82 syn region debcontrolField start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Essential\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\|\%(XS-\)\=Testsuite\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline | 125 syn region debcontrolField start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\|\%(XS-\)\=Testsuite\|Build-Profiles\|Tag\|Subarchitecture\|Kernel-Version\|Installer-Menu-Item\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline |
83 syn region debcontrolMultiField start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Uploaders\|Description\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment | 126 syn region debcontrolMultiField start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\|Uploaders\|X[SBC]\{0,3\}\%(Private-\)\=-[-a-zA-Z0-9]\+\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment |
84 syn region debcontrolMultiFieldSpell start="^\%(Description\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell | 127 syn region debcontrolMultiFieldSpell start="^\%(Description\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell |
85 | 128 |
86 " Associate our matches and regions with pretty colours | 129 " Associate our matches and regions with pretty colours |
87 hi def link debcontrolKey Keyword | 130 hi def link debcontrolKey Keyword |
88 hi def link debcontrolField Normal | 131 hi def link debcontrolField Normal |
100 hi def link debcontrolVcsSvn Identifier | 143 hi def link debcontrolVcsSvn Identifier |
101 hi def link debcontrolVcsCvs Identifier | 144 hi def link debcontrolVcsCvs Identifier |
102 hi def link debcontrolVcsGit Identifier | 145 hi def link debcontrolVcsGit Identifier |
103 hi def link debcontrolHTTPUrl Identifier | 146 hi def link debcontrolHTTPUrl Identifier |
104 hi def link debcontrolDmUpload Identifier | 147 hi def link debcontrolDmUpload Identifier |
148 hi def link debcontrolYesNo Identifier | |
149 hi def link debcontrolR3 Identifier | |
105 hi def link debcontrolComment Comment | 150 hi def link debcontrolComment Comment |
106 hi def link debcontrolElse Special | 151 hi def link debcontrolElse Special |
107 | 152 |
108 let b:current_syntax = "debcontrol" | 153 let b:current_syntax = "debcontrol" |
109 | 154 |