UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

2 lines 3.03 kB
import{n as e}from"./rolldown-runtime-DkW27tQK.js";function t(e){return RegExp(`^((`+e.join(`)|(`)+`))\\b`)}function n(e,t){if(e.eatSpace())return null;if(e.match(/[{}]/))return`bracket`;if(e.match(`[]`))return`keyword`;if(e.match(d)||e.match(u))return`operator`;if(e.match(m))return`atom`;var n=e.match(g);if(n)return t.doInCurrentLine?t.doInCurrentLine=!1:t.currentIndent++,n[0]==`proc`||n[0]==`fun`?t.tokenize=a:n[0]==`class`?t.tokenize=r:n[0]==`meth`&&(t.tokenize=i),`keyword`;if(e.match(_)||e.match(h))return`keyword`;if(e.match(v))return t.currentIndent--,`keyword`;var c=e.next();if(c==`"`||c==`'`)return t.tokenize=s(c),t.tokenize(e,t);if(/[~\d]/.test(c)){if(c==`~`){if(!/^[0-9]/.test(e.peek()))return null;if(e.next()==`0`&&e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))return`number`}return c==`0`&&e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/)?`number`:null}return c==`%`?(e.skipToEnd(),`comment`):c==`/`&&e.eat(`*`)?(t.tokenize=o,o(e,t)):l.test(c)?`operator`:(e.eatWhile(/\w/),`variable`)}function r(e,t){return e.eatSpace()?null:(e.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/),t.tokenize=n,`type`)}function i(e,t){return e.eatSpace()?null:(e.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/),t.tokenize=n,`def`)}function a(e,t){return e.eatSpace()?null:!t.hasPassedFirstStage&&e.eat(`{`)?(t.hasPassedFirstStage=!0,`bracket`):t.hasPassedFirstStage?(e.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/),t.hasPassedFirstStage=!1,t.tokenize=n,`def`):(t.tokenize=n,null)}function o(e,t){for(var r=!1,i;i=e.next();){if(i==`/`&&r){t.tokenize=n;break}r=i==`*`}return`comment`}function s(e){return function(t,r){for(var i=!1,a,o=!1;(a=t.next())!=null;){if(a==e&&!i){o=!0;break}i=!i&&a==`\\`}return(o||!i)&&(r.tokenize=n),`string`}}function c(){var e=f.concat(p);return RegExp(`[\\[\\]]|(`+e.join(`|`)+`)$`)}var l,u,d,f,p,m,h,g,_,v,y;function b(){return(b=e((()=>{l=/[\^@!\|<>#~\.\*\-\+\\/,=]/,u=/(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/,d=/(:::)|(\.\.\.)|(=<:)|(>=:)/,f=[`in`,`then`,`else`,`of`,`elseof`,`elsecase`,`elseif`,`catch`,`finally`,`with`,`require`,`prepare`,`import`,`export`,`define`,`do`],p=[`end`],m=t([`true`,`false`,`nil`,`unit`]),h=t([`andthen`,`at`,`attr`,`declare`,`feat`,`from`,`lex`,`mod`,`div`,`mode`,`orelse`,`parser`,`prod`,`prop`,`scanner`,`self`,`syn`,`token`]),g=t([`local`,`proc`,`fun`,`case`,`class`,`if`,`cond`,`or`,`dis`,`choice`,`not`,`thread`,`try`,`raise`,`lock`,`for`,`suchthat`,`meth`,`functor`]),_=t(f),v=t(p),y={name:`oz`,startState:function(){return{tokenize:n,currentIndent:0,doInCurrentLine:!1,hasPassedFirstStage:!1}},token:function(e,t){return e.sol()&&(t.doInCurrentLine=0),t.tokenize(e,t)},indent:function(e,t,n){var r=t.replace(/^\s+|\s+$/g,``);return r.match(v)||r.match(_)||r.match(/(\[])/)?n.unit*(e.currentIndent-1):e.currentIndent<0?0:e.currentIndent*n.unit},languageData:{indentOnInut:c(),commentTokens:{line:`%`,block:{open:`/*`,close:`*/`}}}}})))()}b();export{y as oz}; //# sourceMappingURL=oz-DTY2GRqL.js.map