annotate runtime/syntax/pod.vim @ 34074:1629cc65d78d v9.1.0006

patch 9.1.0006: is*() and to*() function may be unsafe Commit: https://github.com/vim/vim/commit/184f71cc6868a240dc872ed2852542bbc1d43e28 Author: Keith Thompson <Keith.S.Thompson@gmail.com> Date: Thu Jan 4 21:19:04 2024 +0100 patch 9.1.0006: is*() and to*() function may be unsafe Problem: is*() and to*() function may be unsafe Solution: Add SAFE_* macros and start using those instead (Keith Thompson) Use SAFE_() macros for is*() and to*() functions The standard is*() and to*() functions declared in <ctype.h> have undefined behavior for negative arguments other than EOF. If plain char is signed, passing an unchecked value from argv for from user input to one of these functions has undefined behavior. Solution: Add SAFE_*() macros that cast the argument to unsigned char. Most implementations behave sanely for negative arguments, and most character values in practice are non-negative, but it's still best to avoid undefined behavior. The change from #13347 has been omitted, as this has already been separately fixed in commit ac709e2fc0db6d31abb7da96f743c40956b60c3a (v9.0.2054) fixes: #13332 closes: #13347 Signed-off-by: Keith Thompson <Keith.S.Thompson@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 04 Jan 2024 21:30:04 +0100
parents 1e9e9d89f0ee
children
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
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
2 " Language: Perl POD format
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
3 " Maintainer: vim-perl <vim-perl@googlegroups.com>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
4 " Previously: Scott Bigham <dsb@killerbunnies.org>
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
5 " Homepage: https://github.com/vim-perl/vim-perl
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
6 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
7 " License: Vim License (see :help license)
29193
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
8 " Last Change: 2022 Jun 13
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " To add embedded POD documentation highlighting to your syntax file, add
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " the commands:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " syn include @Pod <sfile>:p:h/pod.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " syn region myPOD start="^=pod" start="^=head" end="^=cut" keepend contained contains=@Pod
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " and add myPod to the contains= list of some existing region, probably a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " comment. The "keepend" flag is needed because "=cut" is matched as a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " pattern in its own right.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Remove any old syntax stuff hanging around (this is suppressed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " automatically by ":syn include" if necessary).
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
23 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
24 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
28 let s:cpo_save = &cpo
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
29 set cpo&vim
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
30
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
31 " TODO: add supported encodings when we can utilize better performing Vim 8 features
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
32 syn match podEncoding "[0-9A-Za-z_-]\+" contained contains=@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " Text of a =head1, =head2 or =item command
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
35 syn region podCmdText start="\S.*$" end="^\ze\s*$" end="^\ze=cut\>" contained contains=podFormat,@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " Indent amount of =over command
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
38 syn match podOverIndent "\d*\.\=\d\+\>" contained contains=@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " Formatter identifier keyword for =for, =begin and =end commands
398
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
41 syn match podForKeywd "\S\+" contained contains=@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " An indented line, to be displayed verbatim
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
44 syn region podVerbatim start="^\s\+\S.*$" end="^\ze\s*$" end="^\ze=cut\>" contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
45
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
46 syn region podOrdinary start="^\S.*$" end="^\ze\s*$" end="^\ze=cut\>" contains=podFormat,podSpecial,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " Inline textual items handled specially by POD
398
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
49 syn match podSpecial "\(\<\|&\)\I\i*\(::\I\i*\)*([^)]*)" contains=@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
50 syn match podSpecial "[$@%]\I\i*\(::\I\i*\)*\>" contains=@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " Special formatting sequences
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
53
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
54 syn cluster podFormat contains=podFormat,podFormatError
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
55
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
56 syn match podFormatError "[ADGHJKM-RT-WY]<"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
57
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
58 syn region podFormat matchgroup=podFormatDelimiter start="[IBSCLFX]<" end=">" contains=@podFormat,@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
59 syn region podFormat matchgroup=podFormatDelimiter start="[IBSCLFX]<<\%(\s\+\|$\)" end="\%(\s\+\|^\)>>" contains=@podFormat,@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
60
26
404aac550f35 updated for version 7.0017
vimboss
parents: 7
diff changeset
61 syn match podFormat "Z<>"
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
62
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
63 syn region podFormat matchgroup=podFormatDelimiter start="E<" end=">" oneline contains=podEscape,podEscape2,@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
64
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
65 " HTML entities {{{1
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
66 " Source: Pod/Escapes.pm
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
67 syn keyword podEscape contained lt gt quot amp apos sol verbar lchevron rchevron nbsp iexcl cent pound curren yen brvbar sect uml copy ordf laquo not shy reg macr deg plusmn sup2 sup3 acute micro para middot cedil sup1 ordm raquo frac14 frac12 frac34 iquest Agrave Aacute Acirc Atilde Auml Aring AElig Ccedil Egrave Eacute Ecirc Euml Igrave Iacute Icirc Iuml ETH Ntilde Ograve Oacute Ocirc Otilde Ouml times Oslash Ugrave Uacute Ucirc Uuml Yacute THORN szlig agrave aacute acirc atilde auml aring aelig ccedil egrave eacute ecirc euml igrave iacute icirc iuml eth ntilde ograve oacute ocirc otilde ouml divide oslash ugrave uacute ucirc uuml yacute thorn yuml fnof Alpha Beta Gamma Delta Epsilon Zeta Eta Theta Iota Kappa Lambda Mu Nu Xi Omicron Pi Rho Sigma Tau Upsilon Phi Chi Psi Omega alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigmaf sigma tau upsilon phi chi psi omega thetasym upsih piv bull hellip prime Prime oline frasl weierp image real trade alefsym larr uarr rarr darr harr crarr lArr uArr rArr dArr hArr forall part exist empty nabla isin notin ni prod sum minus lowast radic prop infin ang and or cap cup int there4 sim cong asymp ne equiv le ge sub sup nsub sube supe oplus otimes perp sdot lceil rceil lfloor rfloor lang rang loz spades clubs hearts diams OElig oelig Scaron scaron Yuml circ tilde ensp emsp thinsp zwnj zwj lrm rlm ndash mdash lsquo rsquo sbquo ldquo rdquo bdquo dagger Dagger permil lsaquo rsaquo
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
68 " }}}
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
69
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
70 syn match podEscape2 "\d\+" contained contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
71 syn match podEscape2 "0\=x\x\+" contained contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
72 syn match podEscape2 "0\o\+" contained contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
73
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
74
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
75 " POD commands
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
76 syn match podCommand "^=encoding\>" nextgroup=podEncoding skipwhite contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
77 syn match podCommand "^=head[1234]\>" nextgroup=podCmdText skipwhite skipnl contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
78 syn match podCommand "^=item\>" nextgroup=podCmdText skipwhite skipnl contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
79 syn match podCommand "^=over\>" nextgroup=podOverIndent skipwhite contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
80 syn match podCommand "^=back" contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
81 syn match podCommand "^=cut" contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
82 syn match podCommand "^=pod" contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
83 syn match podCommand "^=for" nextgroup=podForKeywd skipwhite contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
84 syn match podCommand "^=begin" nextgroup=podForKeywd skipwhite contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
85 syn match podCommand "^=end" nextgroup=podForKeywd skipwhite contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
86
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
87 " Comments
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
88
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
89 syn keyword podForKeywd comment contained nextgroup=podForComment skipwhite skipnl
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
90
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
91 if exists("perl_pod_no_comment_fold")
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
92 syn region podBeginComment start="^=begin\s\+comment\s*$" end="^=end\s\+comment\ze\s*$" keepend extend contains=podCommand
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
93 syn region podForComment start="\S.*$" end="^\ze\s*$" end="^\ze=cut\>" contained contains=@Spell,podTodo
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
94 else
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
95 syn region podBeginComment start="^=begin\s\+comment\s*$" end="^=end\s\+comment\ze\s*$" keepend extend contains=podCommand,podTodo fold
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
96 syn region podForComment start="\S.*$" end="^\ze\s*$" end="^\ze=cut\>" contained contains=@Spell,podTodo fold
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
97 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
98
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
99 syn keyword podTodo contained TODO FIXME XXX
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
100
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
101 " Plain Pod files
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
102 syn region podNonPod start="\%^\%(=\w\+\>\)\@!" end="^\ze=\a\w*\>"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
103 syn region podNonPod matchgroup=podCommand start="^=cut\>" end="\%$"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
104 syn region podNonPod matchgroup=podCommand start="^=cut\>" end="^\ze=\a\w*\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
107 " Only when an item doesn't have highlighting yet
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
109 hi def link podCommand Statement
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
110 hi def link podBeginComment Comment
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
111 hi def link podForComment Comment
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
112 hi def link podNonPod Comment
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
113 hi def link podTodo Todo
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
114 hi def link podCmdText String
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
115 hi def link podEncoding Constant
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
116 hi def link podOverIndent Number
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
117 hi def link podForKeywd Identifier
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
118 hi def link podVerbatim PreProc
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
119 hi def link podFormat Identifier
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
120 hi def link podFormatDelimiter podFormat
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
121 hi def link podFormatError Error
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
122 hi def link podSpecial Identifier
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
123 hi def link podEscape Constant
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
124 hi def link podEscape2 Number
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
126 if exists("perl_pod_spellcheck_headings")
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
127 " Spell-check headings
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
128 syn clear podCmdText
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
129 syn region podCmdText start="\S.*$" end="^\s*$" end="^\ze=cut\>" contained contains=podFormat
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
130 endif
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
131
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
132 if exists("perl_pod_formatting")
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
133 " By default, escapes like C<> are not checked for spelling. Remove B<>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
134 " and I<> from the list of escapes.
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
135 syn clear podFormat
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
136 syn region podFormat start="[CLF]<[^<]"me=e-1 end=">" contains=@podFormat,@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
137 syn region podFormat start="[CLF]<<\%(\s\+\|$\)" end="\%(\s\+\|^\)>>" contains=@podFormat,@NoSpell
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
138
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
139 " Don't spell-check inside E<>, but ensure that the E< itself isn't
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
140 " marked as a spelling mistake.
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
141 syn region podFormat start="E<" end=">" oneline contains=podEscape,podEscape2,@NoSpell
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
142
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
143 " Z<> is a mock formatting code. Ensure Z<> on its own isn't marked as a
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
144 " spelling mistake.
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
145 syn match podFormat "Z<>" contains=podEscape,podEscape2,@NoSpell
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
146
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
147 " These are required so that whatever is *within* B<...>, I<...>, etc. is
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
148 " spell-checked, but not the B, I, ... itself.
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
149 syn match podBoldOpen "B<" contains=@NoSpell
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
150 syn match podItalicOpen "I<" contains=@NoSpell
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
151 syn match podNoSpaceOpen "S<" contains=@NoSpell
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
152 syn match podIndexOpen "X<" contains=@NoSpell
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
153
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
154 " Same as above but for the << >> syntax.
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
155 syn match podBoldAlternativeDelimOpen "B<<\%(\s\+\|$\)" contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
156 syn match podItalicAlternativeDelimOpen "I<<\%(\s\+\|$\)" contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
157 syn match podNoSpaceAlternativeDelimOpen "S<<\%(\s\+\|$\)" contains=@NoSpell
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
158 syn match podIndexAlternativeDelimOpen "X<<\%(\s\+\|$\)" contains=@NoSpell
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
159
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
160 " Add support for spell checking text inside B<>, I<>, S<> and X<>.
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
161 syn region podBold start="B<[^<]"me=e end=">" contains=podBoldItalic,podBoldOpen
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
162 syn region podBoldAlternativeDelim start="B<<\%(\s\+\|$\)" end="\%(\s\+\|^\)>>" contains=podBoldAlternativeDelimOpen
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
163
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
164 syn region podItalic start="I<[^<]"me=e end=">" contains=podItalicBold,podItalicOpen
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
165 syn region podItalicAlternativeDelim start="I<<\%(\s\+\|$\)" end="\%(\s\+\|^\)>>" contains=podItalicAlternativeDelimOpen
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
166
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
167 " Nested bold/italic and vice-versa
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
168 syn region podBoldItalic contained start="I<[^<]"me=e end=">"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
169 syn region podItalicBold contained start="B<[^<]"me=e end=">"
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
170
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
171 syn region podNoSpace start="S<[^<]"ms=s-2 end=">"me=e contains=podNoSpaceOpen
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
172 syn region podNoSpaceAlternativeDelim start="S<<\%(\s\+\|$\)"ms=s-2 end="\%(\s\+\|^\)>>"me=e contains=podNoSpaceAlternativeDelimOpen
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
173
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
174 syn region podIndex start="X<[^<]"ms=s-2 end=">"me=e contains=podIndexOpen
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
175 syn region podIndexAlternativeDelim start="X<<\%(\s\+\|$\)"ms=s-2 end="\%(\s\+\|^\)>>"me=e contains=podIndexAlternativeDelimOpen
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
176
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
177 " Restore this (otherwise B<> is shown as bold inside verbatim)
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
178 syn region podVerbatim start="^\s\+\S.*$" end="^\ze\s*$" end="^\ze=cut\>" contains=@NoSpell
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
179
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
180 " Ensure formatted text can be displayed in headings and items
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
181 syn clear podCmdText
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
182
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
183 if exists("perl_pod_spellcheck_headings")
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
184 syn match podCmdText ".*$" contained contains=@podFormat,podBold,
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
185 \podBoldAlternativeDelim,podItalic,podItalicAlternativeDelim,
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
186 \podBoldOpen,podItalicOpen,podBoldAlternativeDelimOpen,
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
187 \podItalicAlternativeDelimOpen,podNoSpaceOpen
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
188 else
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
189 syn match podCmdText ".*$" contained contains=@podFormat,podBold,
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
190 \podBoldAlternativeDelim,podItalic,podItalicAlternativeDelim,
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
191 \@NoSpell
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
192 endif
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
193
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
194 " Specify how to display these
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
195 hi def podBold term=bold cterm=bold gui=bold
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
196
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
197 hi link podBoldAlternativeDelim podBold
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
198 hi link podBoldAlternativeDelimOpen podBold
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
199 hi link podBoldOpen podBold
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
200
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
201 hi link podNoSpace Identifier
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
202 hi link podNoSpaceAlternativeDelim Identifier
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
203
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
204 hi link podIndex Identifier
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
205 hi link podIndexAlternativeDelim Identifier
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
206
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
207 hi def podItalic term=italic cterm=italic gui=italic
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
208
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
209 hi link podItalicAlternativeDelim podItalic
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
210 hi link podItalicAlternativeDelimOpen podItalic
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
211 hi link podItalicOpen podItalic
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
212
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
213 hi def podBoldItalic term=italic,bold cterm=italic,bold gui=italic,bold
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
214 hi def podItalicBold term=italic,bold cterm=italic,bold gui=italic,bold
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
215 endif
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
216
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 let b:current_syntax = "pod"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
219 let &cpo = s:cpo_save
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
220 unlet s:cpo_save
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
221
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
222 " vim: ts=8 fdm=marker: