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
5 " Last Change: 2001 May 09
7 " To learn more about SMIL, please refer to http://www.w3.org/AudioVideo/
8 " and to http://www.helio.org/products/smil/tutorial/
10 " For version 5.x: Clear all syntax items
11 " For version 6.x: Quit when a syntax file was already loaded
14 elseif exists("b:current_syntax")
18 " SMIL is case sensitive
22 syn match smilError "[<>&]"
23 syn match smilError "[()&]"
25 if !exists("main_syntax")
26 let main_syntax = 'smil'
30 syn match smilSpecial contained "\\\d\d\d\|\\."
31 syn match smilSpecial contained "("
32 syn match smilSpecial contained "id("
33 syn match smilSpecial contained ")"
34 syn keyword smilSpecial contained remove freeze true false on off overdub caption new pause replace
35 syn keyword smilSpecial contained first last
36 syn keyword smilSpecial contained fill meet slice scroll hidden
37 syn region smilString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=smilSpecial
38 syn region smilString contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=smilSpecial
39 syn match smilValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1
40 syn region smilEndTag start=+</+ end=+>+ contains=smilTagN,smilTagError
41 syn region smilTag start=+<[^/]+ end=+>+ contains=smilTagN,smilString,smilArg,smilValue,smilTagError,smilEvent,smilCssDefinition
42 syn match smilTagN contained +<\s*[-a-zA-Z0-9]\++ms=s+1 contains=smilTagName,smilSpecialTagName
43 syn match smilTagN contained +</\s*[-a-zA-Z0-9]\++ms=s+2 contains=smilTagName,smilSpecialTagName
44 syn match smilTagError contained "[^>]<"ms=s+1
47 syn keyword smilTagName contained smil head body anchor a switch region layout meta
48 syn match smilTagName contained "root-layout"
49 syn keyword smilTagName contained par seq
50 syn keyword smilTagName contained animation video img audio ref text textstream
51 syn match smilTagName contained "\<\(head\|body\)\>"
55 syn keyword smilArg contained dur begin end href target id coords show title abstract author copyright alt
56 syn keyword smilArg contained left top width height fit src name content fill longdesc repeat type
57 syn match smilArg contained "z-index"
58 syn match smilArg contained " end-sync"
59 syn match smilArg contained " region"
60 syn match smilArg contained "background-color"
61 syn match smilArg contained "system-bitrate"
62 syn match smilArg contained "system-captions"
63 syn match smilArg contained "system-overdub-or-caption"
64 syn match smilArg contained "system-language"
65 syn match smilArg contained "system-required"
66 syn match smilArg contained "system-screen-depth"
67 syn match smilArg contained "system-screen-size"
68 syn match smilArg contained "clip-begin"
69 syn match smilArg contained "clip-end"
70 syn match smilArg contained "skip-content"
74 " This are new SMIL functionnalities seen on www.w3.org on August 3rd 1999
77 syn keyword smilTagName contained animate set move
78 syn keyword smilArg contained calcMode from to by additive values origin path
79 syn keyword smilArg contained accumulate hold attribute
80 syn match smilArg contained "xml:link"
81 syn keyword smilSpecial contained discrete linear spline parent layout
82 syn keyword smilSpecial contained top left simple
85 syn keyword smilTagName contained area
86 syn keyword smilArg contained actuate behavior inline sourceVolume
87 syn keyword smilArg contained destinationVolume destinationPlaystate tabindex
88 syn keyword smilArg contained class style lang dir onclick ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup shape nohref accesskey onfocus onblur
89 syn keyword smilSpecial contained play pause stop rect circ poly child par seq
92 syn keyword smilTagName contained rtpmap
93 syn keyword smilArg contained port transport encoding payload clipBegin clipEnd
94 syn match smilArg contained "fmt-list"
96 " Timing and Synchronization
97 syn keyword smilTagName contained excl
98 syn keyword smilArg contained beginEvent endEvent eventRestart endSync repeatCount repeatDur
99 syn keyword smilArg contained syncBehavior syncTolerance
100 syn keyword smilSpecial contained canSlip locked
103 syn match smilSpecialChar "&[^;]*;"
105 if exists("smil_wrong_comments")
106 syn region smilComment start=+<!--+ end=+-->+
108 syn region smilComment start=+<!+ end=+>+ contains=smilCommentPart,smilCommentError
109 syn match smilCommentError contained "[^><!]"
110 syn region smilCommentPart contained start=+--+ end=+--+
112 syn region smilComment start=+<!DOCTYPE+ keepend end=+>+
114 " Define the default highlighting.
115 " For version 5.7 and earlier: only when not done already
116 " For version 5.8 and later: only when an item doesn't have highlighting yet
117 if version >= 508 || !exists("did_smil_syntax_inits")
119 let did_smil_syntax_inits = 1
120 command -nargs=+ HiLink hi link <args>
122 command -nargs=+ HiLink hi def link <args>
125 HiLink smilTag Function
126 HiLink smilEndTag Identifier
128 HiLink smilTagName smilStatement
129 HiLink smilSpecialTagName Exception
130 HiLink smilValue Value
131 HiLink smilSpecialChar Special
133 HiLink smilSpecial Special
134 HiLink smilSpecialChar Special
135 HiLink smilString String
136 HiLink smilStatement Statement
137 HiLink smilComment Comment
138 HiLink smilCommentPart Comment
139 HiLink smilPreProc PreProc
140 HiLink smilValue String
141 HiLink smilCommentError smilError
142 HiLink smilTagError smilError
143 HiLink smilError Error
148 let b:current_syntax = "smil"
150 if main_syntax == 'smil'