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