diff options
author | Clément Pit--Claudel <clement.pitclaudel@live.com> | 2015-07-29 16:55:49 -0700 |
---|---|---|
committer | Clément Pit--Claudel <clement.pitclaudel@live.com> | 2015-07-29 16:55:49 -0700 |
commit | 13bb45d5350cb6b0ce6b731d6552780b0d147265 (patch) | |
tree | aa304c1c9157b3a74d4cdce5297e09cc28dbdb05 | |
parent | fe6ba192bd4430f27e4379c584fbc082bf49be18 (diff) |
Update the VS extension to use the error interface defined in 576eac2e17ff
-rw-r--r-- | Source/Dafny/Parser.cs | 2 | ||||
-rw-r--r-- | Source/Dafny/Util.cs | 10 | ||||
-rw-r--r-- | Source/DafnyExtension/DafnyDriver.cs | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/Source/Dafny/Parser.cs b/Source/Dafny/Parser.cs index 86a185a4..fd6fb026 100644 --- a/Source/Dafny/Parser.cs +++ b/Source/Dafny/Parser.cs @@ -4702,7 +4702,7 @@ public class Errors { count++;
}
- public void Warning(IToken tok, string msg) { // warnings
+ public virtual void Warning(IToken tok, string msg) { // warnings
Contract.Requires(tok != null);
Contract.Requires(msg != null);
Dafny.Util.ReportIssue("Warning", tok, msg);
diff --git a/Source/Dafny/Util.cs b/Source/Dafny/Util.cs index a0a7fe36..508d23c6 100644 --- a/Source/Dafny/Util.cs +++ b/Source/Dafny/Util.cs @@ -67,26 +67,26 @@ namespace Microsoft.Dafny { return res;
}
- internal static void ReportIssue(string header, IToken tok, string msg, params object[] args) {
+ public static void ReportIssue(string header, IToken tok, string msg, params object[] args) {
ReportIssue(header, tok, String.Format(msg, args));
}
- internal static void ReportIssue(string header, IToken tok, string msg) {
+ public static void ReportIssue(string header, IToken tok, string msg) {
ReportIssue(header, tok.filename, tok.line, tok.col, msg);
}
- internal static void ReportIssue(string header, string filename, int line, int column, string msg) {
+ public static void ReportIssue(string header, string filename, int line, int column, string msg) {
Console.WriteLine(ReportIssueToString(header, filename, line, column, msg));
}
- internal static string ReportIssueToString(string header, string filename, int line, int column, string msg) {
+ public static string ReportIssueToString(string header, string filename, int line, int column, string msg) {
Contract.Requires(header != null);
Contract.Requires(filename != null);
Contract.Requires(msg != null);
return ReportIssueToString_Bare(": " + header, filename, line, column, ": " + msg);
}
- internal static string ReportIssueToString_Bare(string header, string filename, int line, int column, string msg) {
+ public static string ReportIssueToString_Bare(string header, string filename, int line, int column, string msg) {
return String.Format("{0}({1},{2}){3}{4}", filename, line, column - 1, header, msg ?? "");
}
diff --git a/Source/DafnyExtension/DafnyDriver.cs b/Source/DafnyExtension/DafnyDriver.cs index 61328fbf..640ef67c 100644 --- a/Source/DafnyExtension/DafnyDriver.cs +++ b/Source/DafnyExtension/DafnyDriver.cs @@ -151,8 +151,8 @@ namespace DafnyLanguage dd.RecordError(filename, line - 1, col - 1, ErrorCategory.ResolveError, msg);
count++;
}
- public override void Warning(string filename, int line, int col, string msg) {
- dd.RecordError(filename, line - 1, col - 1, ErrorCategory.ParseWarning, msg);
+ public override void Warning(IToken tok, string msg) {
+ dd.RecordError(tok.filename, tok.line - 1, tok.col - 1, ErrorCategory.ParseWarning, msg);
}
}
|