openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
2 lines • 6.41 kB
JavaScript
import{n as e}from"./rolldown-runtime-DkW27tQK.js";function t(e){return RegExp(`^((`+e.join(`)|(`)+`))\\b`)}function n(e){return e.scopes[e.scopes.length-1]}function r(e){for(var r=`error`,s=e.delimiters||e.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,c=[e.singleOperators,e.doubleOperators,e.doubleDelimiters,e.tripleDelimiters,e.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],l=0;l<c.length;l++)c[l]||c.splice(l--,1);var u=e.hangingIndent,d=a,f=o;e.extra_keywords!=null&&(d=d.concat(e.extra_keywords)),e.extra_builtins!=null&&(f=f.concat(e.extra_builtins));var p=!(e.version&&Number(e.version)<3);if(p){var m=e.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;d=d.concat([`nonlocal`,`None`,`aiter`,`anext`,`async`,`await`,`breakpoint`,`match`,`case`]),f=f.concat([`ascii`,`bytes`,`exec`,`print`]);var h=RegExp(`^(([rbuf]|(br)|(rb)|(fr)|(rf))?('{3}|"{3}|['"]))`,`i`)}else{var m=e.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;d=d.concat([`exec`,`print`]),f=f.concat([`apply`,`basestring`,`buffer`,`cmp`,`coerce`,`execfile`,`file`,`intern`,`long`,`raw_input`,`reduce`,`reload`,`unichr`,`unicode`,`xrange`,`None`]);var h=RegExp(`^(([rubf]|(ur)|(br))?('{3}|"{3}|['"]))`,`i`)}var g=t(d),_=t(f);function v(e,t){var r=e.sol()&&t.lastToken!=`\\`;if(r&&(t.indent=e.indentation()),r&&n(t).type==`py`){var i=n(t).offset;if(e.eatSpace()){var a=e.indentation();return a>i?S(e,t):a<i&&w(e,t)&&e.peek()!=`#`&&(t.errorToken=!0),null}var o=y(e,t);return i>0&&w(e,t)&&(o+=` error`),o}return y(e,t)}function y(e,t,n){if(e.eatSpace())return null;if(!n&&e.match(/^#.*/))return`comment`;if(e.match(/^[0-9\.]/,!1)){var a=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(a=!0),e.match(/^[\d_]+\.\d*/)&&(a=!0),e.match(/^\.\d+/)&&(a=!0),a)return e.eat(/J/i),`number`;var o=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(o=!0),e.match(/^0b[01_]+/i)&&(o=!0),e.match(/^0o[0-7_]+/i)&&(o=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),`number`}if(e.match(h))return e.current().toLowerCase().indexOf(`f`)===-1?(t.tokenize=x(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=b(e.current(),t.tokenize),t.tokenize(e,t));for(var l=0;l<c.length;l++)if(e.match(c[l]))return`operator`;return e.match(s)?`punctuation`:t.lastToken==`.`&&e.match(m)?`property`:e.match(g)||e.match(i)?`keyword`:e.match(_)?`builtin`:e.match(/^(self|cls)\b/)?`self`:e.match(m)?t.lastToken==`def`||t.lastToken==`class`?`def`:`variable`:(e.next(),n?null:r)}function b(t,n){for(;`rubf`.indexOf(t.charAt(0).toLowerCase())>=0;)t=t.substr(1);var i=t.length==1,a=`string`;function o(e){return function(t,n){var r=y(t,n,!0);return r==`punctuation`&&(t.current()==`{`?n.tokenize=o(e+1):t.current()==`}`&&(n.tokenize=e>1?o(e-1):s)),r}}function s(s,c){for(;!s.eol();)if(s.eatWhile(/[^'"\{\}\\]/),s.eat(`\\`)){if(s.next(),i&&s.eol())return a}else if(s.match(t))return c.tokenize=n,a;else if(s.match(`{{`))return a;else if(s.match(`{`,!1))return c.tokenize=o(0),s.current()?a:c.tokenize(s,c);else if(s.match(`}}`))return a;else if(s.match(`}`))return r;else s.eat(/['"]/);if(i){if(e.singleLineStringErrors)return r;c.tokenize=n}return a}return s.isString=!0,s}function x(t,n){for(;`rubf`.indexOf(t.charAt(0).toLowerCase())>=0;)t=t.substr(1);var i=t.length==1,a=`string`;function o(o,s){for(;!o.eol();)if(o.eatWhile(/[^'"\\]/),o.eat(`\\`)){if(o.next(),i&&o.eol())return a}else if(o.match(t))return s.tokenize=n,a;else o.eat(/['"]/);if(i){if(e.singleLineStringErrors)return r;s.tokenize=n}return a}return o.isString=!0,o}function S(e,t){for(;n(t).type!=`py`;)t.scopes.pop();t.scopes.push({offset:n(t).offset+e.indentUnit,type:`py`,align:null})}function C(e,t,n){var r=e.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+(u||e.indentUnit),type:n,align:r})}function w(e,t){for(var r=e.indentation();t.scopes.length>1&&n(t).offset>r;){if(n(t).type!=`py`)return!0;t.scopes.pop()}return n(t).offset!=r}function T(e,t){e.sol()&&(t.beginningOfLine=!0,t.dedent=!1);var i=t.tokenize(e,t),a=e.current();if(t.beginningOfLine&&a==`@`)return e.match(m,!1)?`meta`:p?`operator`:r;if(/\S/.test(a)&&(t.beginningOfLine=!1),(i==`variable`||i==`builtin`)&&t.lastToken==`meta`&&(i=`meta`),(a==`pass`||a==`return`)&&(t.dedent=!0),a==`lambda`&&(t.lambda=!0),a==`:`&&!t.lambda&&n(t).type==`py`&&e.match(/^\s*(?:#|$)/,!1)&&S(e,t),a.length==1&&!/string|comment/.test(i)){var o=`[({`.indexOf(a);if(o!=-1&&C(e,t,`])}`.slice(o,o+1)),o=`])}`.indexOf(a),o!=-1){if(n(t).type==a)t.indent=t.scopes.pop().offset-(u||e.indentUnit);else return r}}return t.dedent&&e.eol()&&n(t).type==`py`&&t.scopes.length>1&&t.scopes.pop(),i}return{name:`python`,startState:function(){return{tokenize:v,scopes:[{offset:0,type:`py`,align:null}],indent:0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var i=T(e,t);return i&&i!=`comment`&&(t.lastToken=i==`keyword`||i==`punctuation`?e.current():i),i==`punctuation`&&(i=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r:i},indent:function(e,t,r){if(e.tokenize!=v)return e.tokenize.isString?null:0;var i=n(e),a=i.type==t.charAt(0)||i.type==`py`&&!e.dedent&&/^(else:|elif |except |finally:)/.test(t);return i.align==null?i.offset-(a?u||r.unit:0):i.align-+!!a},languageData:{autocomplete:a.concat(o).concat([`exec`,`print`]),indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,commentTokens:{line:`#`},closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,`'''`,`"""`]}}}}var i,a,o,s,c;function l(){return(l=e((()=>{i=t([`and`,`or`,`not`,`is`]),a=`as.assert.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.lambda.pass.raise.return.try.while.with.yield.in.False.True`.split(`.`),o=`abs.all.any.bin.bool.bytearray.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip.__import__.NotImplemented.Ellipsis.__debug__`.split(`.`),s=function(e){return e.split(` `)},r({}),c=r({extra_keywords:s(`by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE`)})})))()}l();export{c as cython};
//# sourceMappingURL=python-COs-kvPa.js.map