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