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