public InteractiveContext(DyaOptions options) { Options = options; BuildOptions = CreateBuildOptions(options); var nofn = options.FileNames is null || options.FileNames.Length == 0 || string.IsNullOrWhiteSpace(options.FileNames[0]); var lookup = FileLookup.Create(BuildOptions, nofn ? Environment.CurrentDirectory ! : Path.GetDirectoryName(options.FileNames ![0]) !, options.Paths);
private static bool Run(DyaOptions options) { Printer.Header(); ctx = new(options); dispatcher = new(ctx); if (options.Test) { Printer.LineFeed(); return(RunTests(options)); } else if (options.Compile) { Printer.LineFeed(); return(Compile(options)); } else if (options.GenerateIL) { Printer.LineFeed(); return(GenerateIL(options)); } else if (options.FileNames is not null && options.FileNames.Length > 0) { Printer.LineFeed(); var i = 0; foreach (var f in options.GetFileNames()) { if (i > 0) { ctx.Reset(); } if (!ctx.EvalFile(f, options.MeasureTime)) { return(false); } i++; } if (options.StayInInteractive) { RunInteractive(); } else { return(true); } }
public TestRunner(BuilderOptions buildOptions, DyaOptions dyaOptions) => (this.buildOptions, this.dyaOptions, this.stdOut) = (buildOptions, dyaOptions, Console.Out);