annotate runtime/syntax/wml.vim @ 6801:47ebd4065059 v7.4.722

patch 7.4.722 Problem: 0x202f is not recognized as a non-breaking space character. Solution: Add 0x202f to the list. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Mon, 04 May 2015 17:28:22 +0200
parents 3fc0f57ecb91
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: WML - Website MetaLanguage
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Gerfried Fuchs <alfie@ist.org>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Filenames: *.wml
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Last Change: 07 Feb 2002
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " URL: http://alfie.ist.org/software/vim/syntax/wml.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " Original Version: Craig Small <csmall@eye-net.com.au>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " Comments are very welcome - but please make sure that you are commenting on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " the latest version of this file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " SPAM is _NOT_ welcome - be ready to be reported!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " If you are looking for the "Wireless Markup Language" syntax file,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " please take a look at the wap.vim file done by Ralf Schandl, soon in a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " vim-package around your corner :)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " A lot of the web stuff looks like HTML so we load that first
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 so <sfile>:p:h/html.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 runtime! syntax/html.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 if !exists("main_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 let main_syntax = 'wml'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " special character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match wmlNextLine "\\$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " Redfine htmlTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn clear htmlTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn region htmlTag start=+<[^/<]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " Add in extra Arguments used by wml
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn keyword htmlTagName contained gfont imgbg imgdot lowsrc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn keyword htmlTagName contained navbar:define navbar:header
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword htmlTagName contained navbar:footer navbar:prolog
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn keyword htmlTagName contained navbar:epilog navbar:button
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn keyword htmlTagName contained navbar:filter navbar:debug
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn keyword htmlTagName contained navbar:render
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn keyword htmlTagName contained preload rollover
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn keyword htmlTagName contained space hspace vspace over
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword htmlTagName contained ps ds pi ein big sc spaced headline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn keyword htmlTagName contained ue subheadline zwue verbcode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn keyword htmlTagName contained isolatin pod sdf text url verbatim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn keyword htmlTagName contained xtable
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn keyword htmlTagName contained csmap fsview import box
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn keyword htmlTagName contained case:upper case:lower
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn keyword htmlTagName contained grid cell info lang: logo page
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn keyword htmlTagName contained set-var restore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn keyword htmlTagName contained array:push array:show set-var ifdef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn keyword htmlTagName contained say m4 symbol dump enter divert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn keyword htmlTagName contained toc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn keyword htmlTagName contained wml card do refresh oneevent catch spawn
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " The wml arguments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn keyword htmlArg contained adjust background base bdcolor bdspace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn keyword htmlArg contained bdwidth complete copyright created crop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn keyword htmlArg contained direction description domainname eperlfilter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn keyword htmlArg contained file hint imgbase imgstar interchar interline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn keyword htmlArg contained keephr keepindex keywords layout spacing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn keyword htmlArg contained padding nonetscape noscale notag notypo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn keyword htmlArg contained onload oversrc pos select slices style
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn keyword htmlArg contained subselected txtcol_select txtcol_normal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn keyword htmlArg contained txtonly via
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn keyword htmlArg contained mode columns localsrc ordered
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 " Lines starting with an # are usually comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn match wmlComment "^\s*#.*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " The different exceptions to comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn match wmlSharpBang "^#!.*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn match wmlUsed contained "\s\s*[A-Za-z:_-]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn match wmlUse "^\s*#\s*use\s\+" contains=wmlUsed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn match wmlInclude "^\s*#\s*include.+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn region wmlBody contained start=+<<+ end=+>>+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn match wmlLocationId contained "[A-Za-z]\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn region wmlLocation start=+<<+ end=+>>+ contains=wmlLocationId
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 "syn region wmlLocation start=+{#+ end=+#}+ contains=wmlLocationId
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 "syn region wmlLocationed contained start=+<<+ end=+>>+ contains=wmlLocationId
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 syn match wmlDivert "\.\.[a-zA-Z_]\+>>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 syn match wmlDivertEnd "<<\.\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 " new version
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 "syn match wmlDivert "{#[a-zA-Z_]\+#:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 "syn match wmlDivertEnd ":##}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 syn match wmlDefineName contained "\s\+[A-Za-z-]\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 syn region htmlTagName start="\<\(define-tag\|define-region\)" end="\>" contains=wmlDefineName
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 " The perl include stuff
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 if main_syntax != 'perl'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 " Perl script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 syn include @wmlPerlScript <sfile>:p:h/perl.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 syn include @wmlPerlScript syntax/perl.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 syn region perlScript start=+<perl>+ keepend end=+</perl>+ contains=@wmlPerlScript,wmlPerlTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 " eperl between '<:' and ':>' -- Alfie [1999-12-26]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 syn region perlScript start=+<:+ keepend end=+:>+ contains=@wmlPerlScript,wmlPerlTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 syn match wmlPerlTag contained "</*perl>" contains=wmlPerlTagN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 syn keyword wmlPerlTagN contained perl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 hi link wmlPerlTag htmlTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 hi link wmlPerlTagN htmlStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 " verbatim tags -- don't highlight anything in between -- Alfie [2002-02-07]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 syn region wmlVerbatimText start=+<verbatim>+ keepend end=+</verbatim>+ contains=wmlVerbatimTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 syn match wmlVerbatimTag contained "</*verbatim>" contains=wmlVerbatimTagN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 syn keyword wmlVerbatimTagN contained verbatim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 hi link wmlVerbatimTag htmlTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 hi link wmlVerbatimTagN htmlStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 if main_syntax == "html"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 syn sync match wmlHighlight groupthere NONE "</a-zA-Z]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 syn sync match wmlHighlight groupthere perlScript "<perl>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 syn sync match wmlHighlightSkip "^.*['\"].*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 syn sync minlines=10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 if version >= 508 || !exists("did_wml_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 let did_wml_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 let did_wml_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 HiLink wmlNextLine Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 HiLink wmlUse Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 HiLink wmlUsed String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 HiLink wmlBody Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 HiLink wmlDiverted Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 HiLink wmlDivert Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 HiLink wmlDivertEnd Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 HiLink wmlLocationId Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 HiLink wmlLocation Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 " HiLink wmlLocationed Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 HiLink wmlDefineName String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 HiLink wmlComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 HiLink wmlInclude Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 HiLink wmlSharpBang PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 let b:current_syntax = "wml"