summaryrefslogtreecommitdiffstats
path: root/static/python.min.js
diff options
context:
space:
mode:
authorben2018-09-18 10:28:07 +0200
committerben2018-09-18 10:28:07 +0200
commitef8cdd36436ef1bd1303886a101c8ee60c6f9721 (patch)
tree39077d0d9b070cc018738dbd3d246214e4749322 /static/python.min.js
downloadhoneyjs-ef8cdd36436ef1bd1303886a101c8ee60c6f9721.tar.gz
honeyjs-ef8cdd36436ef1bd1303886a101c8ee60c6f9721.tar.bz2
honeyjs-ef8cdd36436ef1bd1303886a101c8ee60c6f9721.tar.xz
Initial public commitHEADmaster
Diffstat (limited to 'static/python.min.js')
-rw-r--r--static/python.min.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/static/python.min.js b/static/python.min.js
new file mode 100644
index 0000000..71fa72a
--- /dev/null
+++ b/static/python.min.js
@@ -0,0 +1,9 @@
+(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],f):f(CodeMirror)})(function(f){f.defineMode("python",function(t,e){function m(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function l(a,b){if(a.sol()){var c=b.scopes[0].offset;if(a.eatSpace()){var d=a.indentation();d>c?k="indent":d<c&&(k="dedent");return null}0<c&&n(a,b)}if(a.eatSpace())return null;if("#"===a.peek())return a.skipToEnd(),
+"comment";if(a.match(/^[0-9\.]/,!1)){c=!1;a.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(c=!0);a.match(/^\d+\.\d*/)&&(c=!0);a.match(/^\.\d+/)&&(c=!0);if(c)return a.eat(/J/i),"number";c=!1;a.match(/^0x[0-9a-f]+/i)&&(c=!0);a.match(/^0b[01]+/i)&&(c=!0);a.match(/^0o[0-7]+/i)&&(c=!0);a.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(a.eat(/J/i),c=!0);a.match(/^0(?![\dx])/i)&&(c=!0);if(c)return a.eat(/L/i),"number"}if(a.match(q))return b.tokenize=u(a.current()),b.tokenize(a,b);if(a.match(v)||a.match(w))return null;if(a.match(x)||
+a.match(y)||a.match(z))return"operator";if(a.match(A))return null;if(a.match(B))return"keyword";if(a.match(C))return"builtin";if(a.match(/^(self|cls)\b/))return"variable-2";if(a.match(p))return"def"==b.lastToken||"class"==b.lastToken?"def":"variable";a.next();return"error"}function u(a){function b(b,f){for(;!b.eol();)if(b.eatWhile(/[^'"\\]/),b.eat("\\")){if(b.next(),c&&b.eol())return"string"}else{if(b.match(a))return f.tokenize=l,"string";b.eat(/['"]/)}if(c){if(e.singleLineStringErrors)return"error";
+f.tokenize=l}return"string"}for(;0<="rub".indexOf(a.charAt(0).toLowerCase());)a=a.substr(1);var c=1==a.length;b.isString=!0;return b}function r(a,b,c){c=c||"py";var d=0;if("py"===c){if("py"!==b.scopes[0].type){b.scopes[0].offset=a.indentation();return}for(a=0;a<b.scopes.length;++a)if("py"===b.scopes[a].type){d=b.scopes[a].offset+t.indentUnit;break}}else d=a.match(/\s*($|#)/,!1)?a.indentation()+D:a.column()+a.current().length;b.scopes.unshift({offset:d,type:c})}function n(a,b,c){c=c||"py";if(1!=b.scopes.length){if("py"===
+b.scopes[0].type){a=a.indentation();c=-1;for(var d=0;d<b.scopes.length;++d)if(a===b.scopes[d].offset){c=d;break}if(-1===c)return!0;for(;b.scopes[0].offset!==a;)b.scopes.shift()}else if("py"===c)b.scopes[0].offset=a.indentation();else{if(b.scopes[0].type!=c)return!0;b.scopes.shift()}return!1}}function E(a,b){k=null;var c=b.tokenize(a,b),d=a.current();if("."===d)return c=a.match(p,!1)?null:"error",null===c&&"meta"===b.lastStyle&&(c="meta"),c;if("@"===d)return a.match(p,!1)?"meta":"error";"variable"!==
+c&&"builtin"!==c||"meta"!==b.lastStyle||(c="meta");if("pass"===d||"return"===d)b.dedent+=1;"lambda"===d&&(b.lambda=!0);(":"===d&&!b.lambda&&"py"==b.scopes[0].type||"indent"===k)&&r(a,b);var e="[({".indexOf(d);-1!==e&&r(a,b,"])}".slice(e,e+1));if("dedent"===k&&n(a,b))return"error";e="])}".indexOf(d);if(-1!==e&&n(a,b,d))return"error";0<b.dedent&&a.eol()&&"py"==b.scopes[0].type&&(1<b.scopes.length&&b.scopes.shift(),--b.dedent);return c}var y=e.singleOperators||/^[\+\-\*/%&|\^~<>!]/,A=e.singleDelimiters||
+/^[\(\)\[\]\{\}@,:`=;\.]/,x=e.doubleOperators||/^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(\/\/)|(\*\*))/,w=e.doubleDelimiters||/^((\+=)|(\-=)|(\*=)|(%=)|(\/=)|(&=)|(\|=)|(\^=))/,v=e.tripleDelimiters||/^((\/\/=)|(>>=)|(<<=)|(\*\*=))/,p=e.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/,D=e.hangingIndent||e.indentUnit,z=m(["and","or","not","is","in"]),g="as assert break class continue def del elif else except finally for from global if import lambda pass raise return try while with yield".split(" "),h="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(" "),
+F="apply basestring buffer cmp coerce execfile file intern long raw_input reduce reload unichr unicode xrange False True None".split(" "),G=["exec","print"],H=["ascii","bytes","exec","print"],I=["nonlocal","False","True","None"];void 0!=e.extra_keywords&&(g=g.concat(e.extra_keywords));void 0!=e.extra_builtins&&(h=h.concat(e.extra_builtins));if(e.version&&3===parseInt(e.version,10)){g=g.concat(I);h=h.concat(H);var q=/^(([rb]|(br))?('{3}|"{3}|['"]))/i}else g=g.concat(G),h=h.concat(F),q=/^(([rub]|(ur)|(br))?('{3}|"{3}|['"]))/i;
+var B=m(g),C=m(h),k=null;return{startState:function(a){return{tokenize:l,scopes:[{offset:a||0,type:"py"}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=E(a,b);b.lastStyle=c;var d=a.current();d&&c&&(b.lastToken=d);a.eol()&&b.lambda&&(b.lambda=!1);return c},indent:function(a){return a.tokenize!=l?a.tokenize.isString?f.Pass:0:a.scopes[0].offset},lineComment:"#",fold:"indent"}});f.defineMIME("text/x-python","python");f.defineMIME("text/x-cython",{name:"python",extra_keywords:"by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE".split(" ")})}); \ No newline at end of file