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(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(t){var s=this.string.charAt(this.pos);if("string"==typeof t)var n=s==t;else n=s&&(t.test?t.test(s):t(s));if(n)return++this.pos,s},eatWhile:function(t){for(var s=this.pos;this.eat(t););return this.pos>s},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);if(s>-1)return this.pos=s,!0},backUp:function(t){this.pos-=t},column:function(){return this.start},indentation:function(){return 0},match:function(t,s,n){function i(t){return n?t.toLowerCase():t}if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&!1!==s&&(this.pos+=r[0].length),r}if(i(this.string).indexOf(i(t),this.pos)==this.pos)return!1!==s&&(this.pos+=t.length),!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)};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,i={};else if(null!=s)n=s.name,i=s;var r=modes[n];if(!r)throw new Error("Unknown mode: "+s);return r(t,i||{})},exports.runMode=function(t,s,n){for(var i=exports.getMode({indentUnit:2},s),r=splitLines(t),e=exports.startState(i),o=0,h=r.length;o<h;++o){o&&n("\n");for(var p=new exports.StringStream(r[o]);!p.eol();){var a=i.token(p,e);n(p.current(),a,o,p.start),p.start=p.pos}}};