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