annotate runtime/syntax/mel.vim @ 39:c16898406ff2

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