?
Path : /home/admin/public_html/old/media/editors/codemirror/addon/runmode/ |
Current File : /home/admin/public_html/old/media/editors/codemirror/addon/runmode/runmode.node.min.js |
function splitLines(t){return t.split(/\r?\n|\r/)}function StringStream(t){this.pos=this.start=0,this.string=t,this.lineStart=0}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.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(t){var e=this.string.charAt(this.pos);if("string"==typeof t)var r=e==t;else var r=e&&(t.test?t.test(e):t(e));return r?(++this.pos,e):void 0},eatWhile:function(t){for(var e=this.pos;this.eat(t););return this.pos>e},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 e=this.string.indexOf(t,this.pos);return e>-1?(this.pos=e,!0):void 0},backUp:function(t){this.pos-=t},column:function(){return this.start-this.lineStart},indentation:function(){return 0},match:function(t,e,r){if("string"!=typeof t){var n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&e!==!1&&(this.pos+=n[0].length),n)}var s=function(t){return r?t.toLowerCase():t},i=this.string.substr(this.pos,t.length);return s(i)==s(t)?(e!==!1&&(this.pos+=t.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}}},exports.StringStream=StringStream,exports.startState=function(t,e,r){return t.startState?t.startState(e,r):!0};var modes=exports.modes={},mimeModes=exports.mimeModes={};exports.defineMode=function(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),modes[t]=e},exports.defineMIME=function(t,e){mimeModes[t]=e},exports.defineMode("null",function(){return{token:function(t){t.skipToEnd()}}}),exports.defineMIME("text/plain","null"),exports.resolveMode=function(t){return"string"==typeof t&&mimeModes.hasOwnProperty(t)?t=mimeModes[t]:t&&"string"==typeof t.name&&mimeModes.hasOwnProperty(t.name)&&(t=mimeModes[t.name]),"string"==typeof t?{name:t}:t||{name:"null"}},exports.getMode=function(t,e){e=exports.resolveMode(e);var r=modes[e.name];if(!r)throw new Error("Unknown mode: "+e);return r(t,e)},exports.registerHelper=exports.registerGlobalHelper=Math.min,exports.runMode=function(t,e,r,n){for(var s=exports.getMode({indentUnit:2},e),i=splitLines(t),o=n&&n.state||exports.startState(s),a=0,h=i.length;h>a;++a){a&&r("\n");var p=new exports.StringStream(i[a]);for(!p.string&&s.blankLine&&s.blankLine(o);!p.eol();){var u=s.token(p,o);r(p.current(),u,a,p.start,o),p.start=p.pos}}},require.cache[require.resolve("../../lib/codemirror")]=require.cache[require.resolve("./runmode.node")];