(function(){self.JSREPLEngine=function(){function b(a,e,d,c,b,f){this.result=d;this.error=c;this.sandbox=b;this.inspect=this.sandbox.console.inspect;this.functionClass=this.sandbox.Function;this.sandbox.__eval=this.sandbox.eval;this.tokenizer=this.sandbox.require("kaffeine/token");this.kaffeine=new (this.sandbox.require("kaffeine"));f()}b.prototype.Compile=function(a){a=this.kaffeine.compile(a);try{new this.functionClass(a)}catch(e){a="("+a+")"}return a};b.prototype.Eval=function(a){var e,d;try{e=
this.Compile(a)}catch(c){c.message="Compiling: "+c.message;this.error(c);return}try{return d=this.sandbox.__eval(e),this.result(d===void 0?"":this.inspect(d))}catch(b){return this.error(b)}};b.prototype.EvalSync=function(a){return this.sandbox.__eval(this.Compile(a))};b.prototype.GetNextLineIndent=function(a){var b,d,c;try{for(c=this.tokenizer.ize(a);c!=null;){if(c.bang)return 0;c=c.next}}catch(g){return 1}try{b=this.kaffeine.compile(a);try{new this.functionClass(b)}catch(f){new this.functionClass("("+
b+")")}d=a.split("\n").slice(-1)[0];return/^\s+/.test(d)?0:false}catch(h){return/^\s*(for|while|if|else)\b|[\[\{\(]$/.test(a)?1:0}};return b}()}).call(this);
