mel.vim 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. " Vim syntax file
  2. " Language: MEL (Maya Extension Language)
  3. " Maintainer: Robert Minsk <egbert@centropolisfx.com>
  4. " Last Change: May 27 1999
  5. " Based on: Bram Moolenaar <Bram@vim.org> C syntax file
  6. " quit when a syntax file was already loaded
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. " when wanted, highlight trailing white space and spaces before tabs
  11. if exists("mel_space_errors")
  12. sy match melSpaceError "\s\+$"
  13. sy match melSpaceError " \+\t"me=e-1
  14. endif
  15. " A bunch of useful MEL keywords
  16. sy keyword melBoolean true false yes no on off
  17. sy keyword melFunction proc
  18. sy match melIdentifier "\$\(\a\|_\)\w*"
  19. sy keyword melStatement break continue return
  20. sy keyword melConditional if else switch
  21. sy keyword melRepeat while for do in
  22. sy keyword melLabel case default
  23. sy keyword melOperator size eval env exists whatIs
  24. sy keyword melKeyword alias
  25. sy keyword melException catch error warning
  26. sy keyword melInclude source
  27. sy keyword melType int float string vector matrix
  28. sy keyword melStorageClass global
  29. sy keyword melDebug trace
  30. sy keyword melTodo contained TODO FIXME XXX
  31. " MEL data types
  32. sy match melCharSpecial contained "\\[ntr\\"]"
  33. sy match melCharError contained "\\[^ntr\\"]"
  34. sy region melString start=+"+ skip=+\\"+ end=+"+ contains=melCharSpecial,melCharError
  35. sy case ignore
  36. sy match melInteger "\<\d\+\(e[-+]\=\d\+\)\=\>"
  37. sy match melFloat "\<\d\+\(e[-+]\=\d\+\)\=f\>"
  38. sy match melFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=f\=\>"
  39. sy match melFloat "\.\d\+\(e[-+]\=\d\+\)\=f\=\>"
  40. sy case match
  41. sy match melCommaSemi contained "[,;]"
  42. sy region melMatrixVector start=/<</ end=/>>/ contains=melInteger,melFloat,melIdentifier,melCommaSemi
  43. sy cluster melGroup contains=melFunction,melStatement,melConditional,melLabel,melKeyword,melStorageClass,melTODO,melCharSpecial,melCharError,melCommaSemi
  44. " catch errors caused by wrong parenthesis
  45. sy region melParen transparent start='(' end=')' contains=ALLBUT,@melGroup,melParenError,melInParen
  46. sy match melParenError ")"
  47. sy match melInParen contained "[{}]"
  48. " comments
  49. sy region melComment start="/\*" end="\*/" contains=melTodo,melSpaceError
  50. sy match melComment "//.*" contains=melTodo,melSpaceError
  51. sy match melCommentError "\*/"
  52. sy region melQuestionColon matchgroup=melConditional transparent start='?' end=':' contains=ALLBUT,@melGroup
  53. if !exists("mel_minlines")
  54. let mel_minlines=15
  55. endif
  56. exec "sy sync ccomment melComment minlines=" . mel_minlines
  57. " Define the default highlighting.
  58. " Only when an item doesn't have highlighting yet
  59. hi def link melBoolean Boolean
  60. hi def link melFunction Function
  61. hi def link melIdentifier Identifier
  62. hi def link melStatement Statement
  63. hi def link melConditional Conditional
  64. hi def link melRepeat Repeat
  65. hi def link melLabel Label
  66. hi def link melOperator Operator
  67. hi def link melKeyword Keyword
  68. hi def link melException Exception
  69. hi def link melInclude Include
  70. hi def link melType Type
  71. hi def link melStorageClass StorageClass
  72. hi def link melDebug Debug
  73. hi def link melTodo Todo
  74. hi def link melCharSpecial SpecialChar
  75. hi def link melString String
  76. hi def link melInteger Number
  77. hi def link melFloat Float
  78. hi def link melMatrixVector Float
  79. hi def link melComment Comment
  80. hi def link melError Error
  81. hi def link melSpaceError melError
  82. hi def link melCharError melError
  83. hi def link melParenError melError
  84. hi def link melInParen melError
  85. hi def link melCommentError melError
  86. let b:current_syntax = "mel"