annotate runtime/syntax/debcontrol.vim @ 9287:af25a1a875db v7.4.1926

commit https://github.com/vim/vim/commit/a890f5e34887bff7616bdb4b9ee0bf98c8d2a8f0 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 12 23:03:19 2016 +0200 patch 7.4.1926 Problem: Possible crash with many history items. Solution: Avoid the index going past the last item.
author Christian Brabandt <cb@256bit.org>
date Sun, 12 Jun 2016 23:15:07 +0200
parents aea5ebf352c4
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
2 " Language: Debian control files
857
b933657f7c9d updated for version 7.0g01
vimboss
parents: 36
diff changeset
3 " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
b933657f7c9d updated for version 7.0g01
vimboss
parents: 36
diff changeset
4 " Former Maintainers: Gerfried Fuchs <alfie@ist.org>
b933657f7c9d updated for version 7.0g01
vimboss
parents: 36
diff changeset
5 " Wichert Akkerman <wakkerma@debian.org>
7384
aea5ebf352c4 commit https://github.com/vim/vim/commit/256972a9849b5d575b62a6a71be5b6934b5b0e8b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
6 " Last Change: 2015 Oct 24
aea5ebf352c4 commit https://github.com/vim/vim/commit/256972a9849b5d575b62a6a71be5b6934b5b0e8b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
7 " URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debcontrol.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " Standard syntax initialization
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
6070
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
16 let s:cpo_save = &cpo
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
17 set cpo&vim
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
18
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
19 " Should match case except for the keys of each field
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
20 syn case match
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
21
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " Everything that is not explicitly matched by the rules below
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn match debcontrolElse "^.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " Common seperators
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match debControlComma ", *"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match debControlSpace " "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
6070
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
29 let s:kernels = '\%(linux\|hurd\|kfreebsd\|knetbsd\|kopensolaris\|netbsd\)'
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
30 let s:archs = '\%(alpha\|amd64\|armeb\|armel\|armhf\|arm64\|avr32\|hppa\|i386'
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
31 \ . '\|ia64\|lpia\|m32r\|m68k\|mipsel\|mips\|powerpcspe\|powerpc\|ppc64el'
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
32 \ . '\|ppc64\|s390x\|s390\|sh3eb\|sh3\|sh4eb\|sh4\|sh\|sparc64\|sparc\|x32\)'
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
33 let s:pairs = 'hurd-i386\|kfreebsd-i386\|kfreebsd-amd64\|knetbsd-i386\|kopensolaris-i386\|netbsd-alpha\|netbsd-i386'
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
34
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " Define some common expressions we can use later on
6070
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
36 exe 'syn match debcontrolArchitecture contained "\%(all\|'. s:kernels .'-any\|\%(any-\)\='. s:archs .'\|'. s:pairs .'\|any\)"'
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
37
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
38 unlet s:kernels s:archs s:pairs
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
39
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2625
diff changeset
40 syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)"
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
41 syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)"
3513
1b584a6f446c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3099
diff changeset
43 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|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
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
44 syn match debcontrolPackageType contained "u\?deb"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match debcontrolVariable contained "\${.\{-}}"
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1624
diff changeset
46 syn match debcontrolDmUpload contained "\cyes"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
48 " A URL (using the domain name definitions from RFC 1034 and 1738), right now
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
49 " only enforce protocol and some sanity on the server/path part;
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
50 syn match debcontrolHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$"
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
51 syn match debcontrolVcsSvn contained "\vsvn%(\+ssh)?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$"
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
52 syn match debcontrolVcsCvs contained "\v%(\-d *)?:pserver:[^@]+\@[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?:/[^[:space:]]*%( [^[:space:]]+)?$"
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
53 syn match debcontrolVcsGit contained "\v%(git|https?)://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?%(\s+-b\s+[^ ~^:?*[\\]+)?$"
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
54
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " An email address
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match debcontrolEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn match debcontrolEmail "<.\{-}>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
59 " #-Comments
3893
c3036f1dca68 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
60 syn match debcontrolComment "^#.*$" contains=@Spell
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
61
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
62 syn case ignore
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
63
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 " List of all legal keys
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3893
diff changeset
65 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\): *"
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3893
diff changeset
66
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3893
diff changeset
67 syn match debcontrolDeprecatedKey contained "^\%(\%(XS-\)\=DM-Upload-Allowed\): *"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 " Fields for which we do strict syntax checking
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture,debcontrolSpace oneline
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2625
diff changeset
71 syn region debcontrolStrictField start="^Multi-Arch" end="$" contains=debcontrolKey,debcontrolMultiArch oneline
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn region debcontrolStrictField start="^\(Package\|Source\)" end="$" contains=debcontrolKey,debcontrolName oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn region debcontrolStrictField start="^Priority" end="$" contains=debcontrolKey,debcontrolPriority oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2625
diff changeset
75 syn region debcontrolStrictField start="^\%(XC-\)\=Package-Type" end="$" contains=debcontrolKey,debcontrolPackageType oneline
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
76 syn region debcontrolStrictField start="^Homepage" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline keepend
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
77 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-\%(Browser\|Arch\|Bzr\|Darcs\|Hg\)" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline keepend
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
78 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Svn" end="$" contains=debcontrolKey,debcontrolVcsSvn,debcontrolHTTPUrl oneline keepend
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
79 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Cvs" end="$" contains=debcontrolKey,debcontrolVcsCvs oneline keepend
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
80 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Git" end="$" contains=debcontrolKey,debcontrolVcsGit oneline keepend
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3893
diff changeset
81 syn region debcontrolStrictField start="^\%(XS-\)\=DM-Upload-Allowed" end="$" contains=debcontrolDeprecatedKey,debcontrolDmUpload oneline
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 " Catch-all for the other legal fields
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
84 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
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
85 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
3893
c3036f1dca68 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
86 syn region debcontrolMultiFieldSpell start="^\%(Description\):" skip="^ " end="^$"me=s-1 end="^[^ #]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 " Associate our matches and regions with pretty colours
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 if version >= 508 || !exists("did_debcontrol_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 let did_debcontrol_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 HiLink debcontrolKey Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 HiLink debcontrolField Normal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 HiLink debcontrolStrictField Error
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3893
diff changeset
100 HiLink debcontrolDeprecatedKey Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 HiLink debcontrolMultiField Normal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 HiLink debcontrolArchitecture Normal
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2625
diff changeset
103 HiLink debcontrolMultiArch Normal
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 HiLink debcontrolName Normal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 HiLink debcontrolPriority Normal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 HiLink debcontrolSection Normal
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
107 HiLink debcontrolPackageType Normal
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 HiLink debcontrolVariable Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 HiLink debcontrolEmail Identifier
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
110 HiLink debcontrolVcsSvn Identifier
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
111 HiLink debcontrolVcsCvs Identifier
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
112 HiLink debcontrolVcsGit Identifier
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
113 HiLink debcontrolHTTPUrl Identifier
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1624
diff changeset
114 HiLink debcontrolDmUpload Identifier
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 857
diff changeset
115 HiLink debcontrolComment Comment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 HiLink debcontrolElse Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 let b:current_syntax = "debcontrol"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
6070
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
123 let &cpo = s:cpo_save
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
124 unlet s:cpo_save
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 5663
diff changeset
125
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 " vim: ts=8 sw=2