public bool Compile(out ICompilationUnitResult compilationUnitResult) { bool compilerSuccess = scriptCompiler.Compile(compilerOptions); compilationUnitResult = CreateResult(compilerOptions.ScriptFile as InMemoryStream); compilationErrors.Clear(); return(compilerSuccess); }
public static string WriteErrors(this ICompilationUnitResult compilationUnitResult) { IEnumerable <string> messages = compilationUnitResult.Errors? .Select(err => $"({err.LineNumber},{err.ColumnNumber}) {err.Description}") .Where(message => !string.IsNullOrWhiteSpace(message)) ?? Array.Empty <string>(); string errorList = string.Join(", ", messages); return($"Compilation Errors: {errorList}"); }