annotate runtime/syntax/mel.vim @ 6892:0d3660c07448

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