protected void RunScript(string fileName) { string contents = File.ReadAllText(Path.Combine(baseDir, fileName)); GlobalPath path = shared.VolumeMgr.GlobalPathFromObject("0:/" + fileName); var compiled = shared.ScriptHandler.Compile(path, 1, contents, "test", new CompilerOptions() { LoadProgramsInSameAddressSpace = false, IsCalledFromRun = false, FuncManager = shared.FunctionManager }); cpu.Boot(); screen.ClearOutput(); cpu.GetCurrentContext().AddParts(compiled); }
public void RunScript(string fileName) { string contents = File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), fileName)); GlobalPath path = shared.VolumeMgr.GlobalPathFromObject("0:/" + fileName); var compiled = shared.ScriptHandler.Compile(path, 1, contents, "test", new CompilerOptions() { LoadProgramsInSameAddressSpace = true, IsCalledFromRun = false, FuncManager = shared.FunctionManager }); cpu.Boot(); screen.ClearOutput(); cpu.GetCurrentContext().AddParts(compiled); foreach (var part in compiled) { Console.WriteLine(part.ToString() + ":" + part.GetHashCode()); hugeDump(part.MergeSections()); } }