%PDF- %PDF-
| Direktori : /data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/coffeescript/ |
| Current File : //data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/coffeescript/coffeescript-min.js |
CodeMirror.defineMode("coffeescript",function(K){var A="error";function O(W){return new RegExp("^(("+W.join(")|(")+"))\\b")}var Q=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?)/;var F=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/;var G=/^[_A-Za-z$][_A-Za-z$0-9]*/;var I=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/;var C=O(["and","or","not","is","isnt","in","instanceof","typeof"]);var B=["for","while","loop","if","unless","else","switch","try","catch","finally","class"];var R=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","throw","when","until"];var J=O(B.concat(R));B=O(B);var L=/^('{3}|\"{3}|['\"])/;var H=/^(\/{3}|\/)/;var M=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"];var U=O(M);function V(c,b){if(c.sol()){if(b.scope.align===null){b.scope.align=false}var X=b.scope.offset;if(c.eatSpace()){var Z=c.indentation();if(Z>X&&b.scope.type=="coffee"){return"indent"}else{if(Z<X){return"dedent"}}return null}else{if(X>0){D(c,b)}}}if(c.eatSpace()){return null}var a=c.peek();if(c.match("####")){c.skipToEnd();return"comment"}if(c.match("###")){b.tokenize=P;return b.tokenize(c,b)}if(a==="#"){c.skipToEnd();return"comment"}if(c.match(/^-?[0-9\.]/,false)){var Y=false;if(c.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)){Y=true}if(c.match(/^-?\d+\.\d*/)){Y=true}if(c.match(/^-?\.\d+/)){Y=true}if(Y){if(c.peek()=="."){c.backUp(1)}return"number"}var W=false;if(c.match(/^-?0x[0-9a-f]+/i)){W=true}if(c.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)){W=true}if(c.match(/^-?0(?![\dx])/i)){W=true}if(W){return"number"}}if(c.match(L)){b.tokenize=S(c.current(),false,"string");return b.tokenize(c,b)}if(c.match(H)){if(c.current()!="/"||c.match(/^.*\//,false)){b.tokenize=S(c.current(),true,"string-2");return b.tokenize(c,b)}else{c.backUp(1)}}if(c.match(Q)||c.match(C)){return"operator"}if(c.match(F)){return"punctuation"}if(c.match(U)){return"atom"}if(c.match(J)){return"keyword"}if(c.match(G)){return"variable"}if(c.match(I)){return"property"}c.next();return A}function S(W,X,Y){return function(a,Z){while(!a.eol()){a.eatWhile(/[^'"\/\\]/);if(a.eat("\\")){a.next();if(X&&a.eol()){return Y}}else{if(a.match(W)){Z.tokenize=V;return Y}else{a.eat(/['"\/]/)}}}if(X){if(K.mode.singleLineStringErrors){Y=A}else{Z.tokenize=V}}return Y}}function P(X,W){while(!X.eol()){X.eatWhile(/[^#]/);if(X.match("###")){W.tokenize=V;break}X.eatWhile("#")}return"comment"}function N(b,Z,Y){Y=Y||"coffee";var a=0,c=false,W=null;for(var X=Z.scope;X;X=X.prev){if(X.type==="coffee"){a=X.offset+K.indentUnit;break}}if(Y!=="coffee"){c=null;W=b.column()+b.current().length}else{if(Z.scope.align){Z.scope.align=false}}Z.scope={offset:a,type:Y,prev:Z.scope,align:c,alignOffset:W}}function D(a,Z){if(!Z.scope.prev){return }if(Z.scope.type==="coffee"){var X=a.indentation();var W=false;for(var Y=Z.scope;Y;Y=Y.prev){if(X===Y.offset){W=true;break}}if(!W){return true}while(Z.scope.prev&&Z.scope.offset!==X){Z.scope=Z.scope.prev}return false}else{Z.scope=Z.scope.prev;return false}}function T(a,Y){var X=Y.tokenize(a,Y);var Z=a.current();if(Z==="."){X=Y.tokenize(a,Y);Z=a.current();if(/^\.[\w$]+$/.test(Z)){return"variable"}else{return A}}if(Z==="return"){Y.dedent+=1}if(((Z==="->"||Z==="=>")&&!Y.lambda&&!a.peek())||X==="indent"){N(a,Y)}var W="[({".indexOf(Z);if(W!==-1){N(a,Y,"])}".slice(W,W+1))}if(B.exec(Z)){N(a,Y)}if(Z=="then"){D(a,Y)}if(X==="dedent"){if(D(a,Y)){return A}}W="])}".indexOf(Z);if(W!==-1){while(Y.scope.type=="coffee"&&Y.scope.prev){Y.scope=Y.scope.prev}if(Y.scope.type==Z){Y.scope=Y.scope.prev}}if(Y.dedent>0&&a.eol()&&Y.scope.type=="coffee"){if(Y.scope.prev){Y.scope=Y.scope.prev}Y.dedent-=1}return X}var E={startState:function(W){return{tokenize:V,scope:{offset:W||0,type:"coffee",prev:null,align:false},lastToken:null,lambda:false,dedent:0}},token:function(Z,Y){var X=Y.scope.align===null&&Y.scope;if(X&&Z.sol()){X.align=false}var W=T(Z,Y);if(X&&W&&W!="comment"){X.align=true}Y.lastToken={style:W,content:Z.current()};if(Z.eol()&&Z.lambda){Y.lambda=false}return W},indent:function(X,Z){if(X.tokenize!=V){return 0}var W=X.scope;var a=Z&&"])}".indexOf(Z.charAt(0))>-1;if(a){while(W.type=="coffee"&&W.prev){W=W.prev}}var Y=a&&W.type===Z.charAt(0);if(W.align){return W.alignOffset-(Y?1:0)}else{return(Y?W.prev:W).offset}},lineComment:"#",fold:"indent"};return E});CodeMirror.defineMIME("text/x-coffeescript","coffeescript");