2 " Language: Mathematica
3 " Maintainer: Wolfgang Waltenberger <wwalten@ben.tuwien.ac.at>
4 " Last Change: Thu 26 Apr 2001 13:20:03 CEST
8 elseif exists("b:current_syntax")
12 syn match mmaError "\*)"
13 syn match mmaFixme "FIXME"
14 syn region mmaComment start=+(\*+ end=+\*)+ skipempty contains=mmaFixme
15 syn match mmaMessage "\a*::\a*"
16 syn region mmaString start=+'+ end=+'+
17 syn region mmaString start=+"+ end=+"+
18 syn region mmaString start=+\\\"+ end=+\"+
19 syn region mmaString start=+\"+ end=+\"+
21 syn match mmaVariable "$\a*"
23 syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}"
24 syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}\(Integer\|Real\|Pattern\|Symbol\)"
25 syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}\(Rational\|Complex\|Head\)"
26 syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}?[A-Za-z01-9`]*"
28 " prefix/infix/postfix notations
29 syn match mmaGenericFunction "[A-Za-z01-9`]*\s*\(\[\|@\)"he=e-1
30 syn match mmaGenericFunction "[A-Za-z01-9`]*\s*\(/@\|@@\)"he=e-2
31 syn match mmaGenericFunction "\~\s*[A-Za-z01-9`]*\s*\~"hs=s+1,he=e-1
32 syn match mmaGenericFunction "//\s*[A-Za-z01-9`]*"hs=s+2
33 syn match mmaOperator "/;"
35 syn match mmaPureFunction "#\d*"
36 syn match mmaPureFunction "&"
38 syn match mmaUnicode "\\\[[a-zA-Z01-9]*\]"
40 if version >= 508 || !exists("did_mma_syn_inits")
42 let did_mma_syn_inits = 1
43 command -nargs=+ HiLink hi link <args>
45 command -nargs=+ HiLink hi def link <args>
48 HiLink mmaOperator Operator
49 HiLink mmaVariable Identifier
50 HiLink mmaString String
51 HiLink mmaUnicode String
52 HiLink mmaMessage Identifier
53 HiLink mmaPattern Identifier
54 HiLink mmaGenericFunction Function
57 HiLink mmaComment Comment
58 HiLink mmaPureFunction Operator
63 let b:current_syntax = "mma"