static void Main(string[] args) { Console.WriteLine("Write you code"); Energy e = new Energy(); e.parse(Console.ReadLine()); if(e.getRunningStatus() == RunningState.Error){ ScriptError se = e.getError(); Console.WriteLine("#Error"); Console.WriteLine(se.Message); Console.WriteLine("On line [" + se.Posision.Line + "] Row [" + se.Posision.Row + "]"); } Console.ReadLine(); }
private static void doFile(string name) { string file = File.ReadAllText(name); Function print = new Function(); print.Name = "print"; print.agument.push("string", "context"); print.call += Print_call; Function useage = new Function(); useage.Name = "useage"; useage.call += Useage_call; for (int i = 1; i <= ticks; i++) { if (isError) return; Energy e = new Energy(); e.setConfig("file.enabled", "true", false); e.setConfig("error.log.file", "tests/log.txt", false); e.push(print); e.push(useage); e.parse(file); if(e.getRunningStatus() != RunningState.Normal) { showErrro(name, e); } } }