summaryrefslogtreecommitdiff
path: root/runtime/syntax/mma.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/syntax/mma.vim')
-rw-r--r--runtime/syntax/mma.vim63
1 files changed, 63 insertions, 0 deletions
diff --git a/runtime/syntax/mma.vim b/runtime/syntax/mma.vim
new file mode 100644
index 000000000..6eb8d66a9
--- /dev/null
+++ b/runtime/syntax/mma.vim
@@ -0,0 +1,63 @@
+" Vim syntax file
+" Language: Mathematica
+" Maintainer: Wolfgang Waltenberger <wwalten@ben.tuwien.ac.at>
+" Last Change: Thu 26 Apr 2001 13:20:03 CEST
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match mmaError "\*)"
+syn match mmaFixme "FIXME"
+syn region mmaComment start=+(\*+ end=+\*)+ skipempty contains=mmaFixme
+syn match mmaMessage "\a*::\a*"
+syn region mmaString start=+'+ end=+'+
+syn region mmaString start=+"+ end=+"+
+syn region mmaString start=+\\\"+ end=+\"+
+syn region mmaString start=+\"+ end=+\"+
+
+syn match mmaVariable "$\a*"
+
+syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}"
+syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}\(Integer\|Real\|Pattern\|Symbol\)"
+syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}\(Rational\|Complex\|Head\)"
+syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}?[A-Za-z01-9`]*"
+
+" prefix/infix/postfix notations
+syn match mmaGenericFunction "[A-Za-z01-9`]*\s*\(\[\|@\)"he=e-1
+syn match mmaGenericFunction "[A-Za-z01-9`]*\s*\(/@\|@@\)"he=e-2
+syn match mmaGenericFunction "\~\s*[A-Za-z01-9`]*\s*\~"hs=s+1,he=e-1
+syn match mmaGenericFunction "//\s*[A-Za-z01-9`]*"hs=s+2
+syn match mmaOperator "/;"
+
+syn match mmaPureFunction "#\d*"
+syn match mmaPureFunction "&"
+
+syn match mmaUnicode "\\\[[a-zA-Z01-9]*\]"
+
+if version >= 508 || !exists("did_mma_syn_inits")
+ if version < 508
+ let did_mma_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink mmaOperator Operator
+ HiLink mmaVariable Identifier
+ HiLink mmaString String
+ HiLink mmaUnicode String
+ HiLink mmaMessage Identifier
+ HiLink mmaPattern Identifier
+ HiLink mmaGenericFunction Function
+ HiLink mmaError Error
+ HiLink mmaFixme Error
+ HiLink mmaComment Comment
+ HiLink mmaPureFunction Operator
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mma"