1(function(a){if(typeof exports=="object"&&typeof module=="object")a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],a);else a(CodeMirror)})(function(a){"use strict";a.defineMode("haml",function(b){var c=a.getMode(b,{name:"htmlmixed"});var d=a.getMode(b,"ruby");function e(a){return function(b,c){var d=b.peek();if(d==a&&c.rubyState.tokenize.length==1){b.next();c.tokenize=g;return"closeAttributeTag"}else{return f(b,c)}}}function f(a,b){if(a.match("-#")){a.skipToEnd();return"comment"}return d.token(a,b.rubyState)}function g(a,b){var d=a.peek();if(b.previousToken.style=="comment"){if(b.indented>b.previousToken.indented){a.skipToEnd();return"commentLine"}}if(b.startOfLine){if(d=="!"&&a.match("!!")){a.skipToEnd();return"tag"}else if(a.match(/^%[\w:#\.]+=/)){b.tokenize=f;return"hamlTag"}else if(a.match(/^%[\w:]+/)){return"hamlTag"}else if(d=="/"){a.skipToEnd();return"comment"}}if(b.startOfLine||b.previousToken.style=="hamlTag"){if(d=="#"||d=="."){a.match(/[\w-#\.]*/);return"hamlAttribute"}}if(b.startOfLine&&!a.match("--\x3e",false)&&(d=="="||d=="-")){b.tokenize=f;return b.tokenize(a,b)}if(b.previousToken.style=="hamlTag"||b.previousToken.style=="closeAttributeTag"||b.previousToken.style=="hamlAttribute"){if(d=="("){b.tokenize=e(")");return b.tokenize(a,b)}else if(d=="{"){if(!a.match(/^\{%.*/)){b.tokenize=e("}");return b.tokenize(a,b)}}}return c.token(a,b.htmlState)}return{startState:function(){var b=a.startState(c);var e=a.startState(d);return{htmlState:b,rubyState:e,indented:0,previousToken:{style:null,indented:0},tokenize:g}},copyState:function(b){return{htmlState:a.copyState(c,b.htmlState),rubyState:a.copyState(d,b.rubyState),indented:b.indented,previousToken:b.previousToken,tokenize:b.tokenize}},token:function(a,b){if(a.sol()){b.indented=a.indentation();b.startOfLine=true}if(a.eatSpace())return null;var c=b.tokenize(a,b);b.startOfLine=false;if(c&&c!="commentLine"){b.previousToken={style:c,indented:b.indented}}if(a.eol()&&b.tokenize==f){a.backUp(1);var d=a.peek();a.next();if(d&&d!=","){b.tokenize=g}}if(c=="hamlTag"){c="tag"}else if(c=="commentLine"){c="comment"}else if(c=="hamlAttribute"){c="attribute"}else if(c=="closeAttributeTag"){c=null}return c}}},"htmlmixed","ruby");a.defineMIME("text/x-haml","haml")});
2//# sourceMappingURL=haml.min.js.map