UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

2 lines 5.44 kB
import{n as e}from"./rolldown-runtime-DkW27tQK.js";function t(e,t,n){return n===void 0&&(n=``),t===void 0&&(t=`\\b`),RegExp(`^`+n+`((`+e.join(`)|(`)+`))`+t)}function n(e){return e.nestedArrays>0}function r(e){return e.nestedGenerators>0}function i(e,t){return t===void 0&&(t=0),e.scopes.length<=t?null:e.scopes[e.scopes.length-(t+1)]}function a(e,t){if(e.match(`#=`,!1))return t.tokenize=s,t.tokenize(e,t);var a=t.leavingExpr;if(e.sol()&&(a=!1),t.leavingExpr=!1,a&&e.match(/^'+/))return`operator`;if(e.match(/\.{4,}/))return`error`;if(e.match(/\.{1,3}/))return`operator`;if(e.eatSpace())return null;var u=e.peek();if(u===`#`)return e.skipToEnd(),`comment`;if(u===`[`&&(t.scopes.push(`[`),t.nestedArrays++),u===`(`&&(t.scopes.push(`(`),t.nestedGenerators++),n(t)&&u===`]`){for(;t.scopes.length&&i(t)!==`[`;)t.scopes.pop();t.scopes.pop(),t.nestedArrays--,t.leavingExpr=!0}if(r(t)&&u===`)`){for(;t.scopes.length&&i(t)!==`(`;)t.scopes.pop();t.scopes.pop(),t.nestedGenerators--,t.leavingExpr=!0}if(n(t)){if(t.lastToken==`end`&&e.match(`:`))return`operator`;if(e.match(`end`))return`number`}var d;if((d=e.match(C,!1))&&t.scopes.push(d[0]),e.match(w,!1)&&t.scopes.pop(),e.match(/^::(?![:\$])/))return t.tokenize=o,t.tokenize(e,t);if(!a&&(e.match(O)||e.match(j)))return`builtin`;if(e.match(h))return`operator`;if(e.match(/^\.?\d/,!1)){var f=RegExp(/^im\b/),p=!1;if(e.match(/^0x\.[0-9a-f_]+p[\+\-]?[_\d]+/i)&&(p=!0),e.match(/^0x[0-9a-f_]+/i)&&(p=!0),e.match(/^0b[01_]+/i)&&(p=!0),e.match(/^0o[0-7_]+/i)&&(p=!0),e.match(/^(?:(?:\d[_\d]*)?\.(?!\.)(?:\d[_\d]*)?|\d[_\d]*\.(?!\.)(?:\d[_\d]*))?([Eef][\+\-]?[_\d]+)?/i)&&(p=!0),e.match(/^\d[_\d]*(e[\+\-]?\d+)?/i)&&(p=!0),p)return e.match(f),t.leavingExpr=!0,`number`}if(e.match(`'`))return t.tokenize=c,t.tokenize(e,t);if(e.match(k))return t.tokenize=l(e.current()),t.tokenize(e,t);if(e.match(D)||e.match(A))return`meta`;if(e.match(g))return null;if(e.match(T))return`keyword`;if(e.match(E))return`builtin`;var m=t.isDefinition||t.lastToken==`function`||t.lastToken==`macro`||t.lastToken==`type`||t.lastToken==`struct`||t.lastToken==`immutable`;return e.match(_)?m?e.peek()===`.`?(t.isDefinition=!0,`variable`):(t.isDefinition=!1,`def`):(t.leavingExpr=!0,`variable`):(e.next(),`error`)}function o(e,t){return e.match(/.*?(?=[,;{}()=\s]|$)/),e.match(`{`)?t.nestedParameters++:e.match(`}`)&&t.nestedParameters>0&&t.nestedParameters--,t.nestedParameters>0?e.match(/.*?(?={|})/)||e.next():t.nestedParameters==0&&(t.tokenize=a),`builtin`}function s(e,t){return e.match(`#=`)&&t.nestedComments++,e.match(/.*?(?=(#=|=#))/)||e.skipToEnd(),e.match(`=#`)&&(t.nestedComments--,t.nestedComments==0&&(t.tokenize=a)),`comment`}function c(e,t){var n=!1,r;if(e.match(v))n=!0;else if(r=e.match(/\\u([a-f0-9]{1,4})(?=')/i)){var i=parseInt(r[1],16);(i<=55295||i>=57344)&&(n=!0,e.next())}else if(r=e.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)){var i=parseInt(r[1],16);i<=1114111&&(n=!0,e.next())}return n?(t.leavingExpr=!0,t.tokenize=a,`string`):(e.match(/^[^']+(?=')/)||e.skipToEnd(),e.match(`'`)&&(t.tokenize=a),`error`)}function l(e){e.substr(-3)===`"""`?e=`"""`:e.substr(-1)===`"`&&(e=`"`);function t(t,n){if(t.eat(`\\`))t.next();else if(t.match(e))return n.tokenize=a,n.leavingExpr=!0,`string`;else t.eat(/[`"]/);return t.eatWhile(/[^\\`"]/),`string`}return t}var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M;function N(){return(N=e((()=>{u=`\\\\[0-7]{1,3}`,d=`\\\\x[A-Fa-f0-9]{1,2}`,f=`\\\\[abefnrtv0%?'"\\\\]`,p=`([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])`,m=[`[<>]:`,`[<>=]=`,`<<=?`,`>>>?=?`,`=>`,`--?>`,`<--[->]?`,`\\/\\/`,`\\.{2,3}`,`[\\.\\\\%*+\\-<>!\\/^|&]=?`,`\\?`,`\\$`,`~`,`:`],h=t(`[<>]:,[<>=]=,[!=]==,<<=?,>>>?=?,=>?,--?>,<--[->]?,\\/\\/,[\\\\%*+\\-<>!\\/^|&\\u00F7\\u22BB]=?,\\?,\\$,~,:,\\u00D7,\\u2208,\\u2209,\\u220B,\\u220C,\\u2218,\\u221A,\\u221B,\\u2229,\\u222A,\\u2260,\\u2264,\\u2265,\\u2286,\\u2288,\\u228A,\\u22C5,\\b(in|isa)\\b(?!.?\\()`.split(`,`),``),g=/^[;,()[\]{}]/,_=/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/,v=t([u,d,f,p],`'`),y=[`begin`,`function`,`type`,`struct`,`immutable`,`let`,`macro`,`for`,`while`,`quote`,`if`,`else`,`elseif`,`try`,`finally`,`catch`,`do`],b=[`end`,`else`,`elseif`,`catch`,`finally`],x=`if.else.elseif.while.for.begin.let.end.do.try.catch.finally.return.break.continue.global.local.const.export.import.importall.using.function.where.macro.module.baremodule.struct.type.mutable.immutable.quote.typealias.abstract.primitive.bitstype`.split(`.`),S=[`true`,`false`,`nothing`,`NaN`,`Inf`],C=t(y),w=t(b),T=t(x),E=t(S),D=/^@[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/,O=/^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/,k=/^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/,A=t(m,``,`@`),j=t(m,``,`:`),M={name:`julia`,startState:function(){return{tokenize:a,scopes:[],lastToken:null,leavingExpr:!1,isDefinition:!1,nestedArrays:0,nestedComments:0,nestedGenerators:0,nestedParameters:0,firstParenPos:-1}},token:function(e,t){var n=t.tokenize(e,t),r=e.current();return r&&n&&(t.lastToken=r),n},indent:function(e,t,n){var r=0;return(t===`]`||t===`)`||/^end\b/.test(t)||/^else/.test(t)||/^catch\b/.test(t)||/^elseif\b/.test(t)||/^finally/.test(t))&&(r=-1),(e.scopes.length+r)*n.unit},languageData:{indentOnInput:/^\s*(end|else|catch|finally)\b$/,commentTokens:{line:`#`,block:{open:`#=`,close:`=#`}},closeBrackets:{brackets:[`(`,`[`,`{`,`"`]},autocomplete:x.concat(S)}}})))()}N();export{M as julia}; //# sourceMappingURL=julia-DCp_A6wD.js.map