public bool Compile(string fileName, out Unit unit) { unit = null; var made = default(Result <Unit>); try { var buffer = SourceBuffer.FromFile(fileName); made = Linker.Compile(buffer); } catch (Exception ex) { Printer.Error($"Unable to read file \"{fileName}\": {ex.Message}"); return(false); } if (made.Messages.Any()) { Printer.PrintErrors(made.Messages); } if (!made.Success) { return(false); } unit = made.Value; return(true); }