%PDF- %PDF-
| Direktori : /data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/haml/ |
| Current File : //data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/haml/haml-min.js |
(function(){CodeMirror.defineMode("haml",function(C){var F=CodeMirror.getMode(C,{name:"htmlmixed"});var A=CodeMirror.getMode(C,"ruby");function E(G){return function(J,I){var H=J.peek();if(H==G&&I.rubyState.tokenize.length==1){J.next();I.tokenize=D;return"closeAttributeTag"}else{return B(J,I)}}}function B(H,G){if(H.match("-#")){H.skipToEnd();return"comment"}return A.token(H,G.rubyState)}function D(I,H){var G=I.peek();if(H.previousToken.style=="comment"){if(H.indented>H.previousToken.indented){I.skipToEnd();return"commentLine"}}if(H.startOfLine){if(G=="!"&&I.match("!!")){I.skipToEnd();return"tag"}else{if(I.match(/^%[\w:#\.]+=/)){H.tokenize=B;return"hamlTag"}else{if(I.match(/^%[\w:]+/)){return"hamlTag"}else{if(G=="/"){I.skipToEnd();return"comment"}}}}}if(H.startOfLine||H.previousToken.style=="hamlTag"){if(G=="#"||G=="."){I.match(/[\w-#\.]*/);return"hamlAttribute"}}if(H.startOfLine&&!I.match("-->",false)&&(G=="="||G=="-")){H.tokenize=B;return null}if(H.previousToken.style=="hamlTag"||H.previousToken.style=="closeAttributeTag"||H.previousToken.style=="hamlAttribute"){if(G=="("){H.tokenize=E(")");return null}else{if(G=="{"){H.tokenize=E("}");return null}}}return F.token(I,H.htmlState)}return{startState:function(){var G=F.startState();var H=A.startState();return{htmlState:G,rubyState:H,indented:0,previousToken:{style:null,indented:0},tokenize:D}},copyState:function(G){return{htmlState:CodeMirror.copyState(F,G.htmlState),rubyState:CodeMirror.copyState(A,G.rubyState),indented:G.indented,previousToken:G.previousToken,tokenize:G.tokenize}},token:function(J,I){if(J.sol()){I.indented=J.indentation();I.startOfLine=true}if(J.eatSpace()){return null}var H=I.tokenize(J,I);I.startOfLine=false;if(H&&H!="commentLine"){I.previousToken={style:H,indented:I.indented}}if(J.eol()&&I.tokenize==B){J.backUp(1);var G=J.peek();J.next();if(G&&G!=","){I.tokenize=D}}if(H=="hamlTag"){H="tag"}else{if(H=="commentLine"){H="comment"}else{if(H=="hamlAttribute"){H="attribute"}else{if(H=="closeAttributeTag"){H=null}}}}return H}}},"htmlmixed","ruby");CodeMirror.defineMIME("text/x-haml","haml")})();