blob: 9f4d5fc462d4571717d99c12bd630d05e6a5a79e [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
78command -nargs=+ HiLink hi def link <args>
Bram Moolenaar071d4272004-06-13 20:20:40 +000079
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020080HiLink 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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000107
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200108delcommand HiLink
Bram Moolenaar071d4272004-06-13 20:20:40 +0000109
110let b:current_syntax = "mel"