public string Evaluate(string input, out object result, out bool result_set)
{
CompiledMethod compiled;
result_set = false;
result = null;
input = Compile (input, out compiled);
if (input != null)
return input;
if (compiled == null)
return null;
//
// The code execution does not need to keep the compiler lock
//
object retval = typeof (QuitValue);
try {
invoke_thread = System.Threading.Thread.CurrentThread;
invoking = true;
compiled (ref retval);
} catch (ThreadAbortException e){
//Thread.ResetAbort ();
Console.WriteLine ("Interrupted!\n{0}", e);
} finally {
invoking = false;
}
//
// We use a reference to a compiler type, in this case
// Driver as a flag to indicate that this was a statement
//
if (!ReferenceEquals (retval, typeof (QuitValue))) {
result_set = true;
result = retval;
}
return null;
}