public static string ReplRead(string prompt, bool lispCompletion, bool symbolCompletion, bool crlf) { try { if (Console.IsInputRedirected) { var s = Console.ReadLine(); if (s == null) { Runtime.Exit(); } return(s); } else { var s = ReplReadImp(prompt, lispCompletion, symbolCompletion, crlf); return(s); } } catch (Exception ex) { Console.Clear(); Console.WriteLine(Runtime.GetDiagnostics(ex)); Console.WriteLine("Temporarily lost control due to console display changes. Input aborted."); Console.Write("Press ENTER to continue."); Console.ReadLine(); return(""); } }
public static void RunGuiMode(CommandLineOptions options) { Runtime.ProgramFeature = "kiezellisp-gui"; Runtime.Repl = false; Runtime.ScriptName = options.ScriptName; Runtime.UserArguments = options.UserArguments; try { Runtime.Reset(); Runtime.RestartLoadFiles(0); Runtime.Run(options.ScriptName, Symbols.LoadPrintKeyword, false, Symbols.LoadVerboseKeyword, false); Runtime.Exit(); } catch (Exception ex) { Runtime.PrintTrace(Runtime.GetDiagnostics(ex)); } }
public static string GetDiagnostics(Exception ex) { return(Runtime.GetDiagnostics(ex)); }