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
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
15 " when wanted, highlight trailing white space and spaces before tabs
16 if exists("mel_space_errors")
17 sy match melSpaceError "\s\+$"
18 sy match melSpaceError " \+\t"me=e-1
21 " A bunch of usefull MEL keyworks
22 sy keyword melBoolean true false yes no on off
24 sy keyword melFunction proc
25 sy match melIdentifier "\$\(\a\|_\)\w*"
27 sy keyword melStatement break continue return
28 sy keyword melConditional if else switch
29 sy keyword melRepeat while for do in
30 sy keyword melLabel case default
31 sy keyword melOperator size eval env exists whatIs
32 sy keyword melKeyword alias
33 sy keyword melException catch error warning
35 sy keyword melInclude source
37 sy keyword melType int float string vector matrix
38 sy keyword melStorageClass global
40 sy keyword melDebug trace
42 sy keyword melTodo contained TODO FIXME XXX
45 sy match melCharSpecial contained "\\[ntr\\"]"
46 sy match melCharError contained "\\[^ntr\\"]"
48 sy region melString start=+"+ skip=+\\"+ end=+"+ contains=melCharSpecial,melCharError
51 sy match melInteger "\<\d\+\(e[-+]\=\d\+\)\=\>"
52 sy match melFloat "\<\d\+\(e[-+]\=\d\+\)\=f\>"
53 sy match melFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=f\=\>"
54 sy match melFloat "\.\d\+\(e[-+]\=\d\+\)\=f\=\>"
57 sy match melCommaSemi contained "[,;]"
58 sy region melMatrixVector start=/<</ end=/>>/ contains=melInteger,melFloat,melIdentifier,melCommaSemi
60 sy cluster melGroup contains=melFunction,melStatement,melConditional,melLabel,melKeyword,melStorageClass,melTODO,melCharSpecial,melCharError,melCommaSemi
62 " catch errors caused by wrong parenthesis
63 sy region melParen transparent start='(' end=')' contains=ALLBUT,@melGroup,melParenError,melInParen
64 sy match melParenError ")"
65 sy match melInParen contained "[{}]"
68 sy region melComment start="/\*" end="\*/" contains=melTodo,melSpaceError
69 sy match melComment "//.*" contains=melTodo,melSpaceError
70 sy match melCommentError "\*/"
72 sy region melQuestionColon matchgroup=melConditional transparent start='?' end=':' contains=ALLBUT,@melGroup
74 if !exists("mel_minlines")
77 exec "sy sync ccomment melComment minlines=" . mel_minlines
79 " Define the default highlighting.
80 " For version 5.7 and earlier: only when not done already
81 " For version 5.8 and later: only when an item doesn't have highlighting yet
82 if version >= 508 || !exists("did_mel_syntax_inits")
84 let did_mel_syntax_inits = 1
85 command -nargs=+ HiLink hi link <args>
87 command -nargs=+ HiLink hi def link <args>
90 HiLink melBoolean Boolean
91 HiLink melFunction Function
92 HiLink melIdentifier Identifier
93 HiLink melStatement Statement
94 HiLink melConditional Conditional
95 HiLink melRepeat Repeat
97 HiLink melOperator Operator
98 HiLink melKeyword Keyword
99 HiLink melException Exception
100 HiLink melInclude Include
102 HiLink melStorageClass StorageClass
103 HiLink melDebug Debug
105 HiLink melCharSpecial SpecialChar
106 HiLink melString String
107 HiLink melInteger Number
108 HiLink melFloat Float
109 HiLink melMatrixVector Float
110 HiLink melComment Comment
111 HiLink melError Error
112 HiLink melSpaceError melError
113 HiLink melCharError melError
114 HiLink melParenError melError
115 HiLink melInParen melError
116 HiLink melCommentError melError
121 let b:current_syntax = "mel"