Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hutchinson <m.j.hutchinson@gmail.com>2015-01-21 04:06:45 +0300
committerMichael Hutchinson <m.j.hutchinson@gmail.com>2015-01-22 23:26:02 +0300
commit45746559aa07942406b341f7794367736ab74d20 (patch)
treedef108c26a18f61a5830312672f42b4d42df024e /main/src/addins/ILAsmBinding
parentedaf3fc350485421d05c5458f7d1130ddf1a39f8 (diff)
Replace broken MSBuild error regex
Using the new (unit-tested) parser from xbuild
Diffstat (limited to 'main/src/addins/ILAsmBinding')
-rw-r--r--main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs22
1 files changed, 2 insertions, 20 deletions
diff --git a/main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs b/main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs
index 1b334259ef..ca951872d9 100644
--- a/main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs
+++ b/main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs
@@ -217,7 +217,6 @@ namespace ILAsmBinding
return exitCode;
}
- static readonly Regex regexError = new Regex (@"^(\s*(?<file>.*?)\s?\((?<line>\d*)(,\s(?<column>\d*[\+]*))?\)\s(:|)\s+)*(?<level>\w+)\s*(:|(--))\s*(?<message>.*)", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
static BuildError CreateErrorFromString (string errorString)
{
// When IncludeDebugInformation is true, prevents the debug symbols stats from breaking this.
@@ -226,25 +225,8 @@ namespace ILAsmBinding
errorString.StartsWith ("Compilation succeeded", StringComparison.Ordinal) ||
errorString.StartsWith ("Compilation failed", StringComparison.Ordinal))
return null;
-
- Match match = regexError.Match(errorString);
- if (!match.Success)
- return null;
-
- var error = new BuildError ();
- error.FileName = match.Result ("${file}") ?? "";
-
- string line = match.Result ("${line}");
- error.Line = !string.IsNullOrEmpty (line) ? Int32.Parse (line) : 0;
-
- string col = match.Result ("${column}");
- if (!string.IsNullOrEmpty (col))
- error.Column = col == "255+" ? -1 : Int32.Parse (col);
-
- error.IsWarning = match.Result ("${level}") == "warning";
- error.ErrorNumber = match.Result ("${number}");
- error.ErrorText = match.Result ("${message}");
- return error;
+
+ return BuildError.FromMSBuildErrorFormat (errorString);
}
}
}