function splitLines(t){return t.split(/\r?\n|\r/)}function StringStream(t){this.pos=this.start=0,this.string=t}StringStream.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||null},next:function(){return this.poss},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var s=this.string.indexOf(t,this.pos);return s>-1?(this.pos=s,!0):void 0},backUp:function(t){this.pos-=t},column:function(){return this.start},indentation:function(){return 0},match:function(t,s,n){function r(t){return n?t.toLowerCase():t}if("string"!=typeof t){var i=this.string.slice(this.pos).match(t);return i&&s!==!1&&(this.pos+=i[0].length),i}return r(this.string).indexOf(r(t),this.pos)==this.pos?(s!==!1&&(this.pos+=t.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)}},exports.StringStream=StringStream,exports.startState=function(t,s,n){return t.startState?t.startState(s,n):!0};var modes=exports.modes={},mimeModes=exports.mimeModes={};exports.defineMode=function(t,s){modes[t]=s},exports.defineMIME=function(t,s){mimeModes[t]=s},exports.getMode=function(t,s){if("string"==typeof s&&mimeModes.hasOwnProperty(s)&&(s=mimeModes[s]),"string"==typeof s)var n=s,r={};else if(null!=s)var n=s.name,r=s;var i=modes[n];if(!i)throw new Error("Unknown mode: "+s);return i(t,r||{})},exports.runMode=function(t,s,n){for(var r=exports.getMode({indentUnit:2},s),i=splitLines(t),e=exports.startState(r),o=0,h=i.length;h>o;++o){o&&n("\n");for(var p=new exports.StringStream(i[o]);!p.eol();){var a=r.token(p,e);n(p.current(),a,o,p.start),p.start=p.pos}}};