7
|
1 " Vim syntax file
|
|
2 " Language: SMIL (Synchronized Multimedia Integration Language)
|
|
3 " Maintainer: Herve Foucher <Herve.Foucher@helio.org>
|
|
4 " URL: http://www.helio.org/vim/syntax/smil.vim
|
3312
|
5 " Last Change: 2012 Feb 03 by Thilo Six
|
7
|
6
|
|
7 " To learn more about SMIL, please refer to http://www.w3.org/AudioVideo/
|
|
8 " and to http://www.helio.org/products/smil/tutorial/
|
|
9
|
|
10 " For version 5.x: Clear all syntax items
|
|
11 " For version 6.x: Quit when a syntax file was already loaded
|
|
12 if version < 600
|
|
13 syntax clear
|
|
14 elseif exists("b:current_syntax")
|
|
15 finish
|
|
16 endif
|
|
17
|
3312
|
18 let s:cpo_save = &cpo
|
|
19 set cpo&vim
|
|
20
|
7
|
21 " SMIL is case sensitive
|
|
22 syn case match
|
|
23
|
|
24 " illegal characters
|
|
25 syn match smilError "[<>&]"
|
|
26 syn match smilError "[()&]"
|
|
27
|
|
28 if !exists("main_syntax")
|
|
29 let main_syntax = 'smil'
|
|
30 endif
|
|
31
|
|
32 " tags
|
|
33 syn match smilSpecial contained "\\\d\d\d\|\\."
|
|
34 syn match smilSpecial contained "("
|
|
35 syn match smilSpecial contained "id("
|
|
36 syn match smilSpecial contained ")"
|
|
37 syn keyword smilSpecial contained remove freeze true false on off overdub caption new pause replace
|
|
38 syn keyword smilSpecial contained first last
|
|
39 syn keyword smilSpecial contained fill meet slice scroll hidden
|
|
40 syn region smilString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=smilSpecial
|
|
41 syn region smilString contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=smilSpecial
|
|
42 syn match smilValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1
|
|
43 syn region smilEndTag start=+</+ end=+>+ contains=smilTagN,smilTagError
|
|
44 syn region smilTag start=+<[^/]+ end=+>+ contains=smilTagN,smilString,smilArg,smilValue,smilTagError,smilEvent,smilCssDefinition
|
|
45 syn match smilTagN contained +<\s*[-a-zA-Z0-9]\++ms=s+1 contains=smilTagName,smilSpecialTagName
|
|
46 syn match smilTagN contained +</\s*[-a-zA-Z0-9]\++ms=s+2 contains=smilTagName,smilSpecialTagName
|
|
47 syn match smilTagError contained "[^>]<"ms=s+1
|
|
48
|
|
49 " tag names
|
|
50 syn keyword smilTagName contained smil head body anchor a switch region layout meta
|
|
51 syn match smilTagName contained "root-layout"
|
|
52 syn keyword smilTagName contained par seq
|
|
53 syn keyword smilTagName contained animation video img audio ref text textstream
|
|
54 syn match smilTagName contained "\<\(head\|body\)\>"
|
|
55
|
|
56
|
|
57 " legal arg names
|
|
58 syn keyword smilArg contained dur begin end href target id coords show title abstract author copyright alt
|
|
59 syn keyword smilArg contained left top width height fit src name content fill longdesc repeat type
|
|
60 syn match smilArg contained "z-index"
|
|
61 syn match smilArg contained " end-sync"
|
|
62 syn match smilArg contained " region"
|
|
63 syn match smilArg contained "background-color"
|
|
64 syn match smilArg contained "system-bitrate"
|
|
65 syn match smilArg contained "system-captions"
|
|
66 syn match smilArg contained "system-overdub-or-caption"
|
|
67 syn match smilArg contained "system-language"
|
|
68 syn match smilArg contained "system-required"
|
|
69 syn match smilArg contained "system-screen-depth"
|
|
70 syn match smilArg contained "system-screen-size"
|
|
71 syn match smilArg contained "clip-begin"
|
|
72 syn match smilArg contained "clip-end"
|
|
73 syn match smilArg contained "skip-content"
|
|
74
|
|
75
|
|
76 " SMIL Boston ext.
|
|
77 " This are new SMIL functionnalities seen on www.w3.org on August 3rd 1999
|
|
78
|
|
79 " Animation
|
|
80 syn keyword smilTagName contained animate set move
|
|
81 syn keyword smilArg contained calcMode from to by additive values origin path
|
|
82 syn keyword smilArg contained accumulate hold attribute
|
|
83 syn match smilArg contained "xml:link"
|
|
84 syn keyword smilSpecial contained discrete linear spline parent layout
|
|
85 syn keyword smilSpecial contained top left simple
|
|
86
|
|
87 " Linking
|
|
88 syn keyword smilTagName contained area
|
|
89 syn keyword smilArg contained actuate behavior inline sourceVolume
|
|
90 syn keyword smilArg contained destinationVolume destinationPlaystate tabindex
|
|
91 syn keyword smilArg contained class style lang dir onclick ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup shape nohref accesskey onfocus onblur
|
|
92 syn keyword smilSpecial contained play pause stop rect circ poly child par seq
|
|
93
|
|
94 " Media Object
|
|
95 syn keyword smilTagName contained rtpmap
|
|
96 syn keyword smilArg contained port transport encoding payload clipBegin clipEnd
|
|
97 syn match smilArg contained "fmt-list"
|
|
98
|
|
99 " Timing and Synchronization
|
|
100 syn keyword smilTagName contained excl
|
|
101 syn keyword smilArg contained beginEvent endEvent eventRestart endSync repeatCount repeatDur
|
|
102 syn keyword smilArg contained syncBehavior syncTolerance
|
|
103 syn keyword smilSpecial contained canSlip locked
|
|
104
|
|
105 " special characters
|
|
106 syn match smilSpecialChar "&[^;]*;"
|
|
107
|
|
108 if exists("smil_wrong_comments")
|
|
109 syn region smilComment start=+<!--+ end=+-->+
|
|
110 else
|
|
111 syn region smilComment start=+<!+ end=+>+ contains=smilCommentPart,smilCommentError
|
|
112 syn match smilCommentError contained "[^><!]"
|
|
113 syn region smilCommentPart contained start=+--+ end=+--+
|
|
114 endif
|
|
115 syn region smilComment start=+<!DOCTYPE+ keepend end=+>+
|
|
116
|
|
117 " Define the default highlighting.
|
|
118 " For version 5.7 and earlier: only when not done already
|
|
119 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
120 if version >= 508 || !exists("did_smil_syntax_inits")
|
|
121 if version < 508
|
|
122 let did_smil_syntax_inits = 1
|
|
123 command -nargs=+ HiLink hi link <args>
|
|
124 else
|
|
125 command -nargs=+ HiLink hi def link <args>
|
|
126 endif
|
|
127
|
|
128 HiLink smilTag Function
|
|
129 HiLink smilEndTag Identifier
|
|
130 HiLink smilArg Type
|
|
131 HiLink smilTagName smilStatement
|
|
132 HiLink smilSpecialTagName Exception
|
|
133 HiLink smilValue Value
|
|
134 HiLink smilSpecialChar Special
|
|
135
|
|
136 HiLink smilSpecial Special
|
|
137 HiLink smilSpecialChar Special
|
|
138 HiLink smilString String
|
|
139 HiLink smilStatement Statement
|
|
140 HiLink smilComment Comment
|
|
141 HiLink smilCommentPart Comment
|
|
142 HiLink smilPreProc PreProc
|
|
143 HiLink smilValue String
|
|
144 HiLink smilCommentError smilError
|
|
145 HiLink smilTagError smilError
|
|
146 HiLink smilError Error
|
|
147
|
|
148 delcommand HiLink
|
|
149 endif
|
|
150
|
|
151 let b:current_syntax = "smil"
|
|
152
|
|
153 if main_syntax == 'smil'
|
|
154 unlet main_syntax
|
|
155 endif
|
|
156
|
3312
|
157 let &cpo = s:cpo_save
|
|
158 unlet s:cpo_save
|
7
|
159 " vim: ts=8
|