UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

2 lines 5.17 kB
import{n as e}from"./rolldown-runtime-DkW27tQK.js";function t(e){for(var t={},n=0,r=e.length;n<r;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(e.sol()&&e.match(`=begin`)&&e.eol())return t.tokenize.push(l),`comment`;if(e.eatSpace())return null;var r=e.next(),a;if(r=="`"||r==`'`||r==`"`)return n(s(r,`string`,r==`"`||r=="`"),e,t);if(r==`/`)return i(e)?n(s(r,`string.special`,!0),e,t):`operator`;if(r==`%`){var o=`string`,u=!0;e.eat(`s`)?o=`atom`:e.eat(/[WQ]/)?o=`string`:e.eat(/[r]/)?o=`string.special`:e.eat(/[wxq]/)&&(o=`string`,u=!1);var d=e.eat(/[^\w\s=]/);return d?(m.propertyIsEnumerable(d)&&(d=m[d]),n(s(d,o,u,!0),e,t)):`operator`}if(r==`#`)return e.skipToEnd(),`comment`;if(r==`<`&&(a=e.match(/^<([-~])[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(c(a[2],a[1]),e,t);if(r==`0`)return e.eat(`x`)?e.eatWhile(/[\da-fA-F]/):e.eat(`b`)?e.eatWhile(/[01]/):e.eatWhile(/[0-7]/),`number`;if(/\d/.test(r))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),`number`;if(r==`?`){for(;e.match(/^\\[CM]-/););return e.eat(`\\`)?e.eatWhile(/\w/):e.next(),`string`}if(r==`:`)return e.eat(`'`)?n(s(`'`,`atom`,!1),e,t):e.eat(`"`)?n(s(`"`,`atom`,!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),`atom`):e.eat(/[\+\-\*\/\&\|\:\!]/)?`atom`:e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),`atom`):`operator`;if(r==`@`&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat(`@`),e.eatWhile(/[\w\xa1-\uffff]/),`propertyName`;if(r==`$`)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),`variableName.special`;if(/[a-zA-Z_\xa1-\uffff]/.test(r))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(`:`)?`atom`:`variable`;if(r==`|`&&(t.varList||t.lastTok==`{`||t.lastTok==`do`))return g=`|`,null;if(/[\(\)\[\]{}\\;]/.test(r))return g=r,null;if(r==`-`&&e.eat(`>`))return`operator`;if(/[=+\-\/*:\.^%<>~|]/.test(r)){var f=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return r==`.`&&!f&&(g=`.`),`operator`}return null}function i(e){for(var t=e.pos,n=0,r,i=!1,a=!1;(r=e.next())!=null;)if(a)a=!1;else{if(`[{(`.indexOf(r)>-1)n++;else if(`]})`.indexOf(r)>-1){if(n--,n<0)break}else if(r==`/`&&n==0){i=!0;break}a=r==`\\`}return e.backUp(e.pos-t),i}function a(e){return e||=1,function(t,n){if(t.peek()==`}`){if(e==1)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=a(e-1)}else t.peek()==`{`&&(n.tokenize[n.tokenize.length-1]=a(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function s(e,t,n,r){return function(i,s){var c=!1,l;for(s.context.type===`read-quoted-paused`&&(s.context=s.context.prev,i.eat(`}`));(l=i.next())!=null;){if(l==e&&(r||!c)){s.tokenize.pop();break}if(n&&l==`#`&&!c){if(i.eat(`{`)){e==`}`&&(s.context={prev:s.context,type:`read-quoted-paused`}),s.tokenize.push(a());break}if(/[@\$]/.test(i.peek())){s.tokenize.push(o());break}}c=!c&&l==`\\`}return t}}function c(e,t){return function(n,r){return t&&n.eatSpace(),n.match(e)?r.tokenize.pop():n.skipToEnd(),`string`}}function l(e,t){return e.sol()&&e.match(`=end`)&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),`comment`}var u,d,f,p,m,h,g,_;function v(){return(v=e((()=>{u=`alias.and.BEGIN.begin.break.case.class.def.defined?.do.else.elsif.END.end.ensure.false.for.if.in.module.next.not.or.redo.rescue.retry.return.self.super.then.true.undef.unless.until.when.while.yield.nil.raise.throw.catch.fail.loop.callcc.caller.lambda.proc.public.protected.private.require.load.require_relative.extend.autoload.__END__.__FILE__.__LINE__.__dir__`.split(`.`),d=t(u),f=t([`def`,`class`,`case`,`for`,`while`,`until`,`module`,`catch`,`loop`,`proc`,`begin`]),p=t([`end`,`until`]),m={"[":`]`,"{":`}`,"(":`)`},h={"]":`[`,"}":`{`,")":`(`},_={name:`ruby`,startState:function(e){return{tokenize:[r],indented:0,context:{type:`top`,indented:-e},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){g=null,e.sol()&&(t.indented=e.indentation());var n=t.tokenize[t.tokenize.length-1](e,t),r,i=g;if(n==`variable`){var a=e.current();n=t.lastTok==`.`?`property`:d.propertyIsEnumerable(e.current())?`keyword`:/^[A-Z]/.test(a)?`tag`:t.lastTok==`def`||t.lastTok==`class`||t.varList?`def`:`variable`,n==`keyword`&&(i=a,f.propertyIsEnumerable(a)?r=`indent`:p.propertyIsEnumerable(a)?r=`dedent`:((a==`if`||a==`unless`)&&e.column()==e.indentation()||a==`do`&&t.context.indented<t.indented)&&(r=`indent`))}return(g||n&&n!=`comment`)&&(t.lastTok=i),g==`|`&&(t.varList=!t.varList),r==`indent`||/[\(\[\{]/.test(g)?t.context={prev:t.context,type:g||n,indented:t.indented}:(r==`dedent`||/[\)\]\}]/.test(g))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine=g==`\\`||n==`operator`),n},indent:function(e,t,n){if(e.tokenize[e.tokenize.length-1]!=r)return null;var i=t&&t.charAt(0),a=e.context,o=a.type==h[i]||a.type==`keyword`&&/^(?:end|until|else|elsif|when|rescue)\b/.test(t);return a.indented+(o?0:n.unit)+(e.continuedLine?n.unit:0)},languageData:{indentOnInput:/^\s*(?:end|rescue|elsif|else|\})$/,commentTokens:{line:`#`},autocomplete:u}}})))()}v();export{_ as ruby}; //# sourceMappingURL=ruby-oUh05Trd.js.map