annotate runtime/syntax/mma.vim @ 671:83a006f81bac v7.0199

updated for version 7.0199
author vimboss
date Thu, 16 Feb 2006 22:11:02 +0000
parents 8fa8d7964cf1
children dc8197342755
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: Mathematica
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
3 " Maintainer: steve layland <layland@wolfram.com>
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
4 " Last Change: Tue May 10 18:31:00 CDT 2005
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
5 " Source: http://vim.sourceforge.net/scripts/script.php?script_id=1273
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
6 " http://members.wri.com/layland/vim/syntax/mma.vim
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
7 "
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
8 " NOTE:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
9 " Empty .m files will automatically be presumed as Matlab files
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
10 " unless you have the following in your .vimrc:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
11 "
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
12 " let filetype_m="mma"
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
13 "
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
14 " I also recommend setting the default 'Comment' hilighting to something
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
15 " other than the color used for 'Function', since both are plentiful in
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
16 " most mathematica files, and they are often the same color (when using
274
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
17 " background=dark).
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
18 "
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
19 " Credits:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
20 " o Original Mathematica syntax version written by
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
21 " Wolfgang Waltenberger <wwalten@ben.tuwien.ac.at>
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
22 " o Some ideas like the CommentStar,CommentTitle were adapted
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
23 " from the Java vim syntax file by Claudio Fleiner. Thanks!
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
24 " o Everything else written by steve <layland@wolfram.com>
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
25 "
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
26 " TODO:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
27 " folding
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
28 " fix nesting
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
29 " finish populating popular symbols
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 elseif exists("b:current_syntax")
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
34 finish
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
37 " Group Definitions:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
38 syntax cluster mmaNotes contains=mmaTodo,mmaFixme
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
39 syntax cluster mmaComments contains=mmaComment,mmaFunctionComment,mmaItem,mmaFunctionTitle,mmaCommentStar
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
40 syntax cluster mmaCommentStrings contains=mmaLooseQuote,mmaCommentString,mmaUnicode
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
41 syntax cluster mmaStrings contains=@mmaCommentStrings,mmaString
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
42 syntax cluster mmaTop contains=mmaOperator,mmaGenericFunction,mmaPureFunction,mmaVariable
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
43
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
44 " Predefined Constants:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
45 " to list all predefined Symbols would be too insane...
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
46 " it's probably smarter to define a select few, and get the rest from
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
47 " context if absolutely necessary.
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
48 " TODO - populate this with other often used Symbols
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
49
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
50 " standard fixed symbols:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
51 syntax keyword mmaVariable True False None Automatic All Null C General
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
52
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
53 " mathematical constants:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
54 syntax keyword mmaVariable Pi I E Infinity ComplexInfinity Indeterminate GoldenRatio EulerGamma Degree Catalan Khinchin Glaisher
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
55
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
56 " stream data / atomic heads:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
57 syntax keyword mmaVariable Byte Character Expression Number Real String Word EndOfFile Integer Symbol
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
58
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
59 " sets:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
60 syntax keyword mmaVariable Integers Complexes Reals Booleans Rationals
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
61
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
62 " character classes:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
63 syntax keyword mmaPattern DigitCharacter LetterCharacter WhitespaceCharacter WordCharacter EndOfString StartOfString EndOfLine StartOfLine WordBoundary
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
64
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
65 " SelectionMove directions/units:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
66 syntax keyword mmaVariable Next Previous After Before Character Word Expression TextLine CellContents Cell CellGroup EvaluationCell ButtonCell GeneratedCell Notebook
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
67 syntax keyword mmaVariable CellTags CellStyle CellLabel
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
68
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
69 " TableForm positions:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
70 syntax keyword mmaVariable Above Below Left Right
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
72 " colors:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
73 syntax keyword mmaVariable Black Blue Brown Cyan Gray Green Magenta Orange Pink Purple Red White Yellow
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
74
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
75 " function attributes
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
76 syntax keyword mmaVariable Protected Listable OneIdentity Orderless Flat Constant NumericFunction Locked ReadProtected HoldFirst HoldRest HoldAll HoldAllComplete SequenceHold NHoldFirst NHoldRest NHoldAll Temporary Stub
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
77
274
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
78 " Comment Sections:
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
79 " this:
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
80 " :that:
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
81 syntax match mmaItem "\%(^[( |*\t]*\)\@<=\%(:\+\|\a\)[a-zA-Z0-9 ]\+:" contained contains=@mmaNotes
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
82
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
83 " Comment Keywords:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
84 syntax keyword mmaTodo TODO NOTE HEY contained
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
85 syntax match mmaTodo "X\{3,}" contained
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
86 syntax keyword mmaFixme FIX[ME] FIXTHIS BROKEN contained
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
87 " yay pirates...
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
88 syntax match mmaFixme "\%(Y\=A\+R\+G\+\|GRR\+\|CR\+A\+P\+\)\%(!\+\)\=" contained
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
89
274
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
90 " EmPHAsis:
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
91 " this unnecessary, but whatever :)
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
92 syntax match mmaemPHAsis "\%(^\|\s\)\([_/]\)[a-zA-Z0-9]\+\%(\s\+[a-zA-Z0-9]\+\)*\1\%(\s\|$\)" contained contains=mmaemPHAsis
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
93 syntax match mmaemPHAsis "\%(^\|\s\)(\@<!\*[a-zA-Z0-9]\+\%(\s\+[a-zA-Z0-9]\+\)*)\@!\*\%(\s\|$\)" contained contains=mmaemPHAsis
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
94
274
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
95 " Regular Comments:
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
96 " (* *)
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
97 " allow nesting (* (* *) *) even though the frontend
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
98 " won't always like it.
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
99 syntax region mmaComment start=+(\*+ end=+\*)+ skipempty contains=@mmaNotes,mmaItem,@mmaCommentStrings,mmaemPHAsis,mmaComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
101 " Function Comments:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
102 " just like a normal comment except the first sentance is Special ala Java
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
103 " (** *)
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
104 " TODO - fix this for nesting, or not...
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
105 syntax region mmaFunctionComment start="(\*\*\+" end="\*\+)" contains=@mmaNotes,mmaItem,mmaFunctionTitle,@mmaCommentStrings,mmaemPHAsis,mmaComment
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
106 syntax region mmaFunctionTitle contained matchgroup=mmaFunctionComment start="\%((\*\*[ *]*\)" matchgroup=mmaFunctionTitle keepend end=".[.!-]\=\s*$" end="[.!-][ \t\r<&]"me=e-1 end="\%(\*\+)\)\@=" contained contains=@mmaNotes,mmaItem,mmaCommentStar
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
107
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
108 " catch remaining (**********)'s
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
109 syntax match mmaComment "(\*\*\+)"
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
110 " catch preceding *
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
111 syntax match mmaCommentStar "^\s*\*\+" contained
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
112
274
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
113 " Variables:
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
114 " Dollar sign variables
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
115 syntax match mmaVariable "$\a\+\d*"
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
116 " Preceding contexts
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
117 syntax match mmaVariable "`\=\a\+\d*`"
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
118
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
119 " Strings:
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
120 " "string"
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
121 " 'string' is not accepted (until literal strings are supported!)
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
122 syntax region mmaString start=+\\\@<!"+ skip=+\\\@<!\\\%(\\\\\)*"+ end=+"+
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
123 syntax region mmaCommentString oneline start=+\\\@<!"+ skip=+\\\@<!\\\%(\\\\\)*"+ end=+"+ contained
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
124
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
125
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
126 " Patterns:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
127 " Each pattern marker below can be Blank[] (_), BlankSequence[] (__)
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
128 " or BlankNullSequence[] (___). Most examples below can also be
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
129 " combined, for example Pattern tests with Default values.
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
130 "
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
131 " _Head Anonymous patterns
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
132 " name_Head
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
133 " name:(_Head|_Head2) Named patterns
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
134 "
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
135 " _Head : val
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
136 " name:_Head:val Default values
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
137 "
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
138 " _Head?testQ,
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
139 " _Head?(test[#]&) Pattern tests
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
140 "
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
141 " name_Head/;test[name] Conditionals
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
142 "
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
143 " _Head:. Predefined Default
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
144 "
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
145 " .. ... Pattern Repeat
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
146
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
147 syntax match mmaPatternError "\%(_\{4,}\|)\s*&\s*)\@!\)" contained
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
148
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
149 "pattern name:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
150 syntax match mmaPattern "[A-Za-z0-9`]\+\s*:\+[=>]\@!" contains=mmaOperator
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
151 "pattern default:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
152 syntax match mmaPattern ": *[^ ,]\+[\], ]\@=" contains=@mmaCommentStrings,@mmaTop,mmaOperator
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
153 "pattern head/test:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
154 syntax match mmaPattern "[A-Za-z0-9`]*_\+\%(\a\+\)\=\%(?([^)]\+)\|?[^\]},]\+\)\=" contains=@mmaTop,@mmaCommentStrings,mmaPatternError
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
156 " Operators:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
157 " /: ^= ^:= UpValue
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
158 " /; Conditional
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
159 " := = DownValue
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
160 " == === ||
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
161 " != =!= && Logic
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
162 " >= <= < >
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
163 " += -= *=
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
164 " /= ++ -- Math
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
165 " ^*
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
166 " -> :> Rules
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
167 " @@ @@@ Apply
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
168 " /@ //@ Map
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
169 " /. //. Replace
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
170 " // @ Function application
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
171 " <> ~~ String/Pattern join
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
172 " ~ infix operator
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
173 " . : Pattern operators
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
174 syntax match mmaOperator "\%(@\{1,3}\|//[.@]\=\)"
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
175 syntax match mmaOperator "\%(/[;:@.]\=\|\^\=:\==\)"
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
176 syntax match mmaOperator "\%([-:=]\=>\|<=\=\)"
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
177 "syntax match mmaOperator "\%(++\=\|--\=\|[/+-*]=\|[^*]\)"
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
178 syntax match mmaOperator "[*+=^.:?-]"
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
179 syntax match mmaOperator "\%(\~\~\=\)"
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
180 syntax match mmaOperator "\%(=\{2,3}\|=\=!=\|||\=\|&&\|!\)" contains=ALLBUT,mmaPureFunction
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181
274
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
182 " Function Usage Messages:
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
183 " "SymbolName::item"
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
184 syntax match mmaMessage "$\=\a\+\d*::\a\+\d*"
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
185
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
186 " Pure Functions:
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
187 syntax match mmaPureFunction "#\%(#\|\d\+\)\="
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
188 syntax match mmaPureFunction "&"
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
189
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
190 " Named Functions:
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
191 " Since everything is pretty much a function, get this straight
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
192 " from context
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
193 syntax match mmaGenericFunction "[A-Za-z0-9`]\+\s*\%([@[]\|/:\|/\=/@\)\@=" contains=mmaOperator
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
194 syntax match mmaGenericFunction "\~\s*[^~]\+\s*\~"hs=s+1,he=e-1 contains=mmaOperator,mmaBoring
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
195 syntax match mmaGenericFunction "//\s*[A-Za-z0-9`]\+"hs=s+2 contains=mmaOperator
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
196
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
197 " Numbers:
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
198 syntax match mmaNumber "\<\%(\d\+\.\=\d*\|\d*\.\=\d\+\)\>"
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
199 syntax match mmaNumber "`\d\+\%(\d\@!\.\|\>\)"
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
200
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
201 " Special Characters:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
202 " \[Name] named character
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
203 " \ooo octal
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
204 " \.xx 2 digit hex
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
205 " \:xxxx 4 digit hex (multibyte unicode)
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
206 syntax match mmaUnicode "\\\[\w\+\d*\]"
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
207 syntax match mmaUnicode "\\\%(\x\{3}\|\.\x\{2}\|:\x\{4}\)"
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
208
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
209 " Syntax Errors:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
210 syntax match mmaError "\*)" containedin=ALLBUT,@mmaComments,@mmaStrings
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
211 syntax match mmaError "\%([&:|+*/?~-]\{3,}\|[.=]\{4,}\|_\@<=\.\{2,}\|`\{2,}\)" containedin=ALLBUT,@mmaComments,@mmaStrings
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
213 " Punctuation:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
214 " things that shouldn't really be highlighted, or highlighted
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
215 " in they're own group if you _really_ want. :)
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
216 " ( ) { }
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
217 " TODO - use Delimiter group?
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
218 syntax match mmaBoring "[(){}]" contained
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
219
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
220 " Function Arguments:
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
221 " anything between brackets []
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
222 " TODO - make good folds for this.
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
223 "syntax region mmaArgument start="\[" end="]" containedin=ALLBUT,@mmaComments,@mmaCommentStrings transparent fold
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
224 "syntax sync fromstart
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
225 "set foldmethod=syntax
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
226 "set foldminlines=10
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 if version >= 508 || !exists("did_mma_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 let did_mma_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
236 " NOTE - the following links are not guaranteed to
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
237 " look good under all colorschemes. You might need to
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
238 " :so $VIMRUNTIME/syntax/hitest.vim and tweak these to
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
239 " look good in yours
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
240
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
241 HiLink mmaComment Comment
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
242 HiLink mmaCommentStar Comment
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
243 HiLink mmaFunctionComment Comment
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
244 HiLink mmaLooseQuote Comment
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
245 HiLink mmaGenericFunction Function
274
8fa8d7964cf1 updated for version 7.0073
vimboss
parents: 271
diff changeset
246 HiLink mmaVariable Identifier
271
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
247 HiLink mmaOperator Operator
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
248 HiLink mmaPatternOp Operator
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
249 HiLink mmaPureFunction Operator
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
250 HiLink mmaString String
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
251 HiLink mmaCommentString String
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
252 HiLink mmaUnicode String
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
253 HiLink mmaMessage Type
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
254 HiLink mmaNumber Type
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
255 HiLink mmaPattern Type
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
256 HiLink mmaError Error
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
257 HiLink mmaFixme Error
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
258 HiLink mmaPatternError Error
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
259 HiLink mmaTodo Todo
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
260 HiLink mmaemPHAsis Special
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
261 HiLink mmaFunctionTitle Special
8d34af900bae updated for version 7.0072
vimboss
parents: 7
diff changeset
262 HiLink mmaItem Preproc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 let b:current_syntax = "mma"