コード例 #1
0
        public bool Compile(out ICompilationUnitResult compilationUnitResult)
        {
            bool compilerSuccess = scriptCompiler.Compile(compilerOptions);

            compilationUnitResult = CreateResult(compilerOptions.ScriptFile as InMemoryStream);
            compilationErrors.Clear();

            return(compilerSuccess);
        }
コード例 #2
0
        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}");
        }