%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/webmin/authentic-theme/unauthenticated/js/codemirror/mode/python/
Upload File :
Create Path :
Current File : //usr/share/webmin/authentic-theme/unauthenticated/js/codemirror/mode/python/python.js

!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e){return e.scopes[e.scopes.length-1]}var r=t(["and","or","not","is"]),i=["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"],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__"];e.registerHelper("hintWords","python",i.concat(o)),e.defineMode("python",function(a,s){function c(e,t){var r=e.sol()&&"\\"!=t.lastToken;if(r&&(t.indent=e.indentation()),r&&"py"==n(t).type){var i=n(t).offset;if(e.eatSpace()){var o=e.indentation();return o>i?p(t):o<i&&m(e,t)&&"#"!=e.peek()&&(t.errorToken=!0),null}var a=l(e,t);return i>0&&m(e,t)&&(a+=" "+b),a}return l(e,t)}function l(e,t){if(e.eatSpace())return null;if(e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var n=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(n=!0),e.match(/^[\d_]+\.\d*/)&&(n=!0),e.match(/^\.\d+/)&&(n=!0),n)return e.eat(/J/i),"number";var i=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(i=!0),e.match(/^0b[01_]+/i)&&(i=!0),e.match(/^0o[0-7_]+/i)&&(i=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),i=!0),e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}if(e.match(F)){return e.current().toLowerCase().indexOf("f")!==-1?(t.tokenize=u(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=f(e.current()),t.tokenize(e,t))}for(var o=0;o<g.length;o++)if(e.match(g[o]))return"operator";return e.match(y)?"punctuation":"."==t.lastToken&&e.match(w)?"property":e.match(E)||e.match(r)?"keyword":e.match(T)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(w)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),b)}function u(e,t){function n(t,n){return t.match(e)?(n.tokenize=r,o):t.match("{")?"punctuation":t.match("}")?(n.tokenize=r,"punctuation"):l(t,n)}function r(r,a){for(;!r.eol();)if(r.eatWhile(/[^'"\{\}\\]/),r.eat("\\")){if(r.next(),i&&r.eol())return o}else{if(r.match(e))return a.tokenize=t,o;if(r.match("{{"))return o;if(r.match("{",!1))return a.tokenize=n,r.current()?o:(r.next(),"punctuation");if(r.match("}}"))return o;if(r.match("}"))return b;r.eat(/['"]/)}if(i){if(s.singleLineStringErrors)return b;a.tokenize=t}return o}for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var i=1==e.length,o="string";return r.isString=!0,r}function f(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=c,r;t.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return b;i.tokenize=c}return r}for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function p(e){for(;"py"!=n(e).type;)e.scopes.pop();e.scopes.push({offset:n(e).offset+a.indentUnit,type:"py",align:null})}function d(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+k,type:n,align:r})}function m(e,t){for(var r=e.indentation();t.scopes.length>1&&n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function h(e,t){e.sol()&&(t.beginningOfLine=!0);var r=t.tokenize(e,t),i=e.current();if(t.beginningOfLine&&"@"==i)return e.match(w,!1)?"meta":z?"operator":b;if(/\S/.test(i)&&(t.beginningOfLine=!1),"variable"!=r&&"builtin"!=r||"meta"!=t.lastToken||(r="meta"),"pass"!=i&&"return"!=i||(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||p(t),1==i.length&&!/string|comment/.test(r)){var o="[({".indexOf(i);if(o!=-1&&d(e,t,"])}".slice(o,o+1)),(o="])}".indexOf(i))!=-1){if(n(t).type!=i)return b;t.indent=t.scopes.pop().offset-k}}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}for(var b="error",y=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,g=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*\/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/],v=0;v<g.length;v++)g[v]||g.splice(v--,1);var k=s.hangingIndent||a.indentUnit,x=i,_=o;void 0!=s.extra_keywords&&(x=x.concat(s.extra_keywords)),void 0!=s.extra_builtins&&(_=_.concat(s.extra_builtins));var z=!(s.version&&Number(s.version)<3);if(z){var w=s.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;x=x.concat(["nonlocal","False","True","None","async","await"]),_=_.concat(["ascii","bytes","exec","print"]);var F=new RegExp("^(([rbuf]|(br)|(fr))?('{3}|\"{3}|['\"]))","i")}else{var w=s.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;x=x.concat(["exec","print"]),_=_.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"]);var F=new RegExp("^(([rubf]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var E=t(x),T=t(_);return{startState:function(e){return{tokenize:c,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=h(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+b:r},indent:function(t,r){if(t.tokenize!=c)return t.tokenize.isString?e.Pass:0;var i=n(t),o=i.type==r.charAt(0);return null!=i.align?i.align-(o?1:0):i.offset-(o?k:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-python","python");e.defineMIME("text/x-cython",{name:"python",extra_keywords:function(e){return e.split(" ")}("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})});

Zerion Mini Shell 1.0