blob: 22b3e85daea0646eaafeef1d49d69c2170615597 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: xmath (a simulation tool)
Bram Moolenaare2719092015-01-10 15:09:25 +01003" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
Bram Moolenaarf37506f2016-08-31 22:22:10 +02004" Last Change: Aug 31, 2016
5" Version: 9
Bram Moolenaare2719092015-01-10 15:09:25 +01006" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XMATH
Bram Moolenaar071d4272004-06-13 20:20:40 +00007
Bram Moolenaarf37506f2016-08-31 22:22:10 +02008" For version 5.x: Clear all syntax items
9" For version 6.x: Quit when a syntax file was already loaded
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020010if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000011 finish
12endif
13
14" parenthesis sanity checker
15syn region xmathZone matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" transparent contains=ALLBUT,xmathError,xmathBraceError,xmathCurlyError
16syn region xmathZone matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" transparent contains=ALLBUT,xmathError,xmathBraceError,xmathParenError
17syn region xmathZone matchgroup=Delimiter start="\[" matchgroup=Delimiter end="]" transparent contains=ALLBUT,xmathError,xmathCurlyError,xmathParenError
18syn match xmathError "[)\]}]"
19syn match xmathBraceError "[)}]" contained
20syn match xmathCurlyError "[)\]]" contained
21syn match xmathParenError "[\]}]" contained
22syn match xmathComma "[,;:]"
23syn match xmathComma "\.\.\.$"
24
25" A bunch of useful xmath keywords
26syn case ignore
27syn keyword xmathFuncCmd function endfunction command endcommand
28syn keyword xmathStatement abort beep debug default define
29syn keyword xmathStatement execute exit pause return undefine
30syn keyword xmathConditional if else elseif endif
31syn keyword xmathRepeat while for endwhile endfor
32syn keyword xmathCmd anigraph deletedatastore keep renamedatastore
33syn keyword xmathCmd autocode deletestd linkhyper renamestd
34syn keyword xmathCmd build deletesuperblock linksim renamesuperblock
35syn keyword xmathCmd comment deletetransition listusertype save
36syn keyword xmathCmd copydatastore deleteusertype load sbadisplay
37syn keyword xmathCmd copystd detailmodel lock set
38syn keyword xmathCmd copysuperblock display minmax_display setsbdefault
39syn keyword xmathCmd createblock documentit modifyblock show
40syn keyword xmathCmd createbubble editcatalog modifybubble showlicense
41syn keyword xmathCmd createconnection erase modifystd showsbdefault
42syn keyword xmathCmd creatertf expandsuperbubble modifysuperblock stop
43syn keyword xmathCmd createstd for modifytransition stopcosim
44syn keyword xmathCmd createsuperblock go modifyusertype syntax
45syn keyword xmathCmd createsuperbubble goto new unalias
46syn keyword xmathCmd createtransition hardcopy next unlock
47syn keyword xmathCmd createusertype help polargraph usertype
48syn keyword xmathCmd delete hyperbuild print whatis
49syn keyword xmathCmd deleteblock if printmodel while
50syn keyword xmathCmd deletebubble ifilter quit who
51syn keyword xmathCmd deleteconnection ipcwc remove xgraph
52
53syn keyword xmathFunc abcd eye irea querystdoptions
54syn keyword xmathFunc abs eyepattern is querysuperblock
55syn keyword xmathFunc acos feedback ISID querysuperblockopt
56syn keyword xmathFunc acosh fft ISID Models querytransition
57syn keyword xmathFunc adconversion fftpdm kronecker querytransitionopt
58syn keyword xmathFunc afeedback filter length qz
59syn keyword xmathFunc all find limit rampinvar
60syn keyword xmathFunc ambiguity firparks lin random
61syn keyword xmathFunc amdemod firremez lin30 randpdm
62syn keyword xmathFunc analytic firwind linearfm randpert
63syn keyword xmathFunc analyze fmdemod linfnorm randsys
64syn keyword xmathFunc any forwdiff lintodb rank
65syn keyword xmathFunc append fprintf list rayleigh
66syn keyword xmathFunc argn frac log rcepstrum
67syn keyword xmathFunc argv fracred log10 rcond
68syn keyword xmathFunc arma freq logm rdintegrate
69syn keyword xmathFunc arma2ss freqcircle lognormal read
70syn keyword xmathFunc armax freqcont logspace real
71syn keyword xmathFunc ascii frequencyhop lowpass rectify
72syn keyword xmathFunc asin fsesti lpopt redschur
73syn keyword xmathFunc asinh fslqgcomp lqgcomp reflect
74syn keyword xmathFunc atan fsregu lqgltr regulator
75syn keyword xmathFunc atan2 fwls ls residue
76syn keyword xmathFunc atanh gabor ls2unc riccati
77syn keyword xmathFunc attach_ac100 garb ls2var riccati_eig
78syn keyword xmathFunc backdiff gaussian lsjoin riccati_schur
79syn keyword xmathFunc balance gcexp lu ricean
80syn keyword xmathFunc balmoore gcos lyapunov rifd
81syn keyword xmathFunc bandpass gdfileselection makecontinuous rlinfo
82syn keyword xmathFunc bandstop gdmessage makematrix rlocus
83syn keyword xmathFunc bj gdselection makepoly rms
84syn keyword xmathFunc blknorm genconv margin rootlocus
85syn keyword xmathFunc bode get markoff roots
86syn keyword xmathFunc bpm get_info30 matchedpz round
87syn keyword xmathFunc bpm2inn get_inn max rref
88syn keyword xmathFunc bpmjoin gfdm maxlike rve_get
89syn keyword xmathFunc bpmsplit gfsk mean rve_info
90syn keyword xmathFunc bst gfskernel mergeseg rve_reset
91syn keyword xmathFunc buttconstr gfunction min rve_update
92syn keyword xmathFunc butterworth ggauss minimal samplehold
93syn keyword xmathFunc cancel giv mkpert schur
94syn keyword xmathFunc canform giv2var mkphase sdf
95syn keyword xmathFunc ccepstrum givjoin mma sds
96syn keyword xmathFunc char gpsk mmaget sdtrsp
97syn keyword xmathFunc chebconstr gpulse mmaput sec
98syn keyword xmathFunc chebyshev gqam mod sech
99syn keyword xmathFunc check gqpsk modal siginterp
100syn keyword xmathFunc cholesky gramp modalstate sign
101syn keyword xmathFunc chop gsawtooth modcarrier sim
102syn keyword xmathFunc circonv gsigmoid mreduce sim30
103syn keyword xmathFunc circorr gsin mtxplt simin
104syn keyword xmathFunc clock gsinc mu simin30
105syn keyword xmathFunc clocus gsqpsk mulhank simout
106syn keyword xmathFunc clsys gsquarewave multipath simout30
107syn keyword xmathFunc coherence gstep musynfit simtransform
108syn keyword xmathFunc colorind GuiDialogCreate mxstr2xmstr sin
109syn keyword xmathFunc combinepf GuiDialogDestroy mxstring2xmstring singriccati
110syn keyword xmathFunc commentof GuiFlush names sinh
111syn keyword xmathFunc compare GuiGetValue nichols sinm
112syn keyword xmathFunc complementaryerf GuiManage noisefilt size
113syn keyword xmathFunc complexenvelope GuiPlot none smargin
114syn keyword xmathFunc complexfreqshift GuiPlotGet norm sns2sys
115syn keyword xmathFunc concatseg GuiSetValue numden sort
116syn keyword xmathFunc condition GuiShellCreate nyquist spectrad
117syn keyword xmathFunc conj GuiShellDeiconify obscf spectrum
118syn keyword xmathFunc conmap GuiShellDestroy observable spline
119syn keyword xmathFunc connect GuiShellIconify oe sprintf
120syn keyword xmathFunc conpdm GuiShellLower ones sqrt
121syn keyword xmathFunc constellation GuiShellRaise ophank sqrtm
122syn keyword xmathFunc consys GuiShellRealize optimize sresidualize
123syn keyword xmathFunc controllable GuiShellUnrealize optscale ss2arma
124syn keyword xmathFunc convolve GuiTimer orderfilt sst
125syn keyword xmathFunc correlate GuiToolCreate orderstate ssv
126syn keyword xmathFunc cos GuiToolDestroy orth stable
127syn keyword xmathFunc cosh GuiToolExist oscmd stair
128syn keyword xmathFunc cosm GuiUnmanage oscope starp
129syn keyword xmathFunc cot GuiWidgetExist osscale step
130syn keyword xmathFunc coth h2norm padcrop stepinvar
131syn keyword xmathFunc covariance h2syn partialsum string
132syn keyword xmathFunc csc hadamard pdm stringex
133syn keyword xmathFunc csch hankelsv pdmslice substr
134syn keyword xmathFunc csum hessenberg pem subsys
135syn keyword xmathFunc ctrcf highpass perfplots sum
136syn keyword xmathFunc ctrlplot hilbert period svd
137syn keyword xmathFunc daug hilberttransform pfscale svplot
138syn keyword xmathFunc dbtolin hinfcontr phaseshift sweep
139syn keyword xmathFunc dct hinfnorm pinv symbolmap
140syn keyword xmathFunc decimate hinfsyn plot sys2sns
141syn keyword xmathFunc defFreqRange histogram plot30 sysic
142syn keyword xmathFunc defTimeRange idfreq pmdemod Sysid
143syn keyword xmathFunc delay idimpulse poisson system
144syn keyword xmathFunc delsubstr idsim poissonimpulse tan
145syn keyword xmathFunc det ifft poleplace tanh
146syn keyword xmathFunc detrend imag poles taper
147syn keyword xmathFunc dht impinvar polezero tfid
148syn keyword xmathFunc diagonal impplot poltrend toeplitz
149syn keyword xmathFunc differentiate impulse polyfit trace
150syn keyword xmathFunc directsequence index polynomial tril
151syn keyword xmathFunc discretize indexlist polyval trim
152syn keyword xmathFunc divide initial polyvalm trim30
153syn keyword xmathFunc domain initmodel prbs triu
154syn keyword xmathFunc dst initx0 product trsp
155syn keyword xmathFunc eig inn2bpm psd truncate
156syn keyword xmathFunc ellipconstr inn2pe put_inn tustin
157syn keyword xmathFunc elliptic inn2unc qpopt uniform
158syn keyword xmathFunc erf insertseg qr val
159syn keyword xmathFunc error int quantize variance
160syn keyword xmathFunc estimator integrate queryblock videolines
161syn keyword xmathFunc etfe integratedump queryblockoptions wcbode
162syn keyword xmathFunc exist interp querybubble wcgain
163syn keyword xmathFunc exp interpolate querybubbleoptionswindow
164syn keyword xmathFunc expm inv querycatalog wtbalance
165syn keyword xmathFunc extractchan invhilbert queryconnection zeros
166syn keyword xmathFunc extractseg iqmix querystd
167
168syn case match
169
170" Labels (supports xmath's goto)
171syn match xmathLabel "^\s*<[a-zA-Z_][a-zA-Z0-9]*>"
172
173" String and Character constants
174" Highlight special characters (those which have a backslash) differently
175syn match xmathSpecial contained "\\\d\d\d\|\\."
Bram Moolenaard5ab34b2007-05-05 17:15:44 +0000176syn region xmathString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=xmathSpecial,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +0000177syn match xmathCharacter "'[^\\]'"
178syn match xmathSpecialChar "'\\.'"
179
180syn match xmathNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
181
182" Comments:
183" xmath supports #... (like Unix shells)
184" and #{ ... }# comment blocks
Bram Moolenaard5ab34b2007-05-05 17:15:44 +0000185syn cluster xmathCommentGroup contains=xmathString,xmathTodo,@Spell
Bram Moolenaar18144c82006-04-12 21:52:12 +0000186syn keyword xmathTodo contained COMBAK DEBUG FIXME Todo TODO XXX
Bram Moolenaard5ab34b2007-05-05 17:15:44 +0000187syn match xmathComment "#.*$" contains=@xmathCommentGroup
188syn region xmathCommentBlock start="#{" end="}#" contains=@xmathCommentGroup
Bram Moolenaar071d4272004-06-13 20:20:40 +0000189
190" synchronizing
191syn sync match xmathSyncComment grouphere xmathCommentBlock "#{"
192syn sync match xmathSyncComment groupthere NONE "}#"
193
194" Define the default highlighting.
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200195if !exists("skip_xmath_syntax_inits")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000196
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200197 hi def link xmathBraceError xmathError
198 hi def link xmathCmd xmathStatement
199 hi def link xmathCommentBlock xmathComment
200 hi def link xmathCurlyError xmathError
201 hi def link xmathFuncCmd xmathStatement
202 hi def link xmathParenError xmathError
Bram Moolenaar071d4272004-06-13 20:20:40 +0000203
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200204 " The default methods for highlighting. Can be overridden later
205 hi def link xmathCharacter Character
206 hi def link xmathComma Delimiter
207 hi def link xmathComment Comment
208 hi def link xmathCommentBlock Comment
209 hi def link xmathConditional Conditional
210 hi def link xmathError Error
211 hi def link xmathFunc Function
212 hi def link xmathLabel PreProc
213 hi def link xmathNumber Number
214 hi def link xmathRepeat Repeat
215 hi def link xmathSpecial Type
216 hi def link xmathSpecialChar SpecialChar
217 hi def link xmathStatement Statement
218 hi def link xmathString String
219 hi def link xmathTodo Todo
Bram Moolenaar071d4272004-06-13 20:20:40 +0000220
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200221endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000222
223let b:current_syntax = "xmath"
224
225" vim: ts=17