コード例 #1
0
 /// <summary>
 /// Log Errors/Warnings/Messages when the compiler reports them.
 /// </summary>
 /// <param name="path">Path to the file where the error was found (null/empty if N/A)</param>
 /// <param name="message">Text of the error/warning/message</param>
 /// <param name="startLine">First line of the block containing the error (0 if N/A)</param>
 /// <param name="startColumn">First column of the block containing the error (0 if N/A)</param>
 /// <param name="endLine">Last line of the block containing the error (0 if N/A)</param>
 /// <param name="endColumn">Last column of the block containing the error (0 if N/A)</param>
 /// <param name="errorCode">Code corresponding to the error</param>
 /// <param name="severity">Error/Warning/Message</param>
 public override void AddError(string path, string message, string lineText, CoreIronPython.Hosting.CodeSpan location, int errorCode, CoreIronPython.Hosting.Severity severity)
 {
     if (ProjectDirectory != null && !System.IO.Path.IsPathRooted(path))
         path = System.IO.Path.Combine(ProjectDirectory, path);
     // Based on the type of event (error/warning/message), report the corresponding type of problem to MSBuild
     switch(severity)
     {
         case CoreIronPython.Hosting.Severity.Error:
             {
                 buildSucceeded = false;
                 taskLogger.LogError(String.Empty, "PY" + errorCode.ToString(), String.Empty, path, location.StartLine, location.StartColumn, location.EndLine, location.EndColumn, message);
                 break;
             }
         case CoreIronPython.Hosting.Severity.Warning:
             {
                 taskLogger.LogWarning(String.Empty, "PY" + errorCode.ToString(), String.Empty, path, location.StartLine, location.StartColumn, location.EndLine, location.EndColumn, message);
                 break;
             }
         case CoreIronPython.Hosting.Severity.Message:
             {
                 taskLogger.LogMessage(message);
                 break;
             }
     }
 }
コード例 #2
0
 public ExperimentalCompiler(IList<string> sourcesFiles, string outputAssembly, CoreIronPython.Hosting.CompilerSink compilerSink)
 {
     this.sourceFiles = (List<string>)sourcesFiles;
     this.outputAssembly = outputAssembly;
     this.errorSink = compilerSink;
 }
コード例 #3
0
 public Compiler(IList<string> sourcesFiles, string OutputAssembly, CoreIronPython.Hosting.CompilerSink compilerSink)
     : base(sourcesFiles, OutputAssembly, compilerSink)
 {
 }