blob: f0f1bcafd306f49ec661486d2e6c9dd14dca75fa [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" 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
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02007" quit when a syntax file was already loaded
8if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00009 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.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020077" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +000078
Bram Moolenaarf37506f2016-08-31 22:22:10 +020079hi def link melBoolean Boolean
80hi def link melFunction Function
81hi def link melIdentifier Identifier
82hi def link melStatement Statement
83hi def link melConditional Conditional
84hi def link melRepeat Repeat
85hi def link melLabel Label
86hi def link melOperator Operator
87hi def link melKeyword Keyword
88hi def link melException Exception
89hi def link melInclude Include
90hi def link melType Type
91hi def link melStorageClass StorageClass
92hi def link melDebug Debug
93hi def link melTodo Todo
94hi def link melCharSpecial SpecialChar
95hi def link melString String
96hi def link melInteger Number
97hi def link melFloat Float
98hi def link melMatrixVector Float
99hi def link melComment Comment
100hi def link melError Error
101hi def link melSpaceError melError
102hi def link melCharError melError
103hi def link melParenError melError
104hi def link melInParen melError
105hi def link melCommentError melError
Bram Moolenaar071d4272004-06-13 20:20:40 +0000106
Bram Moolenaar071d4272004-06-13 20:20:40 +0000107
108let b:current_syntax = "mel"