smil.vim 5.5 KB

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