function i(e){return RegExp("^(("+e.join(")|(")+"))\\b")}var o=RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),c=RegExp("^[\\(\\[\\{\\},:=;\\.]"),s=RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),m=RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),l=RegExp("^((>>=)|(<<=))"),u=RegExp("^[\\]\\)]"),f=RegExp("^[_A-Za-z\xA1-\uFFFF][_A-Za-z0-9\xA1-\uFFFF]*"),d=i("error.eval.function.abs.acos.atan.asin.cos.cosh.exp.log.prod.sum.log10.max.min.sign.sin.sinh.sqrt.tan.reshape.break.zeros.default.margin.round.ones.rand.syn.ceil.floor.size.clear.zeros.eye.mean.std.cov.det.eig.inv.norm.rank.trace.expm.logm.sqrtm.linspace.plot.title.xlabel.ylabel.legend.text.grid.meshgrid.mesh.num2str.fft.ifft.arrayfun.cellfun.input.fliplr.flipud.ismember".split(".")),h=i("return.case.switch.else.elseif.end.endif.endfunction.if.otherwise.do.for.while.try.catch.classdef.properties.events.methods.global.persistent.endfor.endwhile.printf.sprintf.disp.until.continue.pkg".split("."));function a(e,n){return!e.sol()&&e.peek()==="'"?(e.next(),n.tokenize=r,"operator"):(n.tokenize=r,r(e,n))}function g(e,n){return e.match(/^.*%}/)?(n.tokenize=r,"comment"):(e.skipToEnd(),"comment")}function r(e,n){if(e.eatSpace())return null;if(e.match("%{"))return n.tokenize=g,e.skipToEnd(),"comment";if(e.match(/^[%#]/))return e.skipToEnd(),"comment";if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return e.tokenize=r,"number";if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)||e.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}if(e.match(i(["nan","NaN","inf","Inf"])))return"number";var t=e.match(/^"(?:[^"]|"")*("|$)/)||e.match(/^'(?:[^']|'')*('|$)/);return t?t[1]?"string":"error":e.match(h)?"keyword":e.match(d)?"builtin":e.match(f)?"variable":e.match(o)||e.match(s)?"operator":e.match(c)||e.match(m)||e.match(l)?null:e.match(u)?(n.tokenize=a,null):(e.next(),"error")}const k={name:"octave",startState:function(){return{tokenize:r}},token:function(e,n){var t=n.tokenize(e,n);return(t==="number"||t==="variable")&&(n.tokenize=a),t},languageData:{commentTokens:{line:"%"}}};export{k as t};
