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