summaryrefslogtreecommitdiff
path: root/Source/DafnyExtension
diff options
context:
space:
mode:
authorGravatar wuestholz <unknown>2014-09-22 17:37:04 +0200
committerGravatar wuestholz <unknown>2014-09-22 17:37:04 +0200
commitfc9efd04b96896b6c4bbb94bdfa494787d23b0a4 (patch)
tree4e04dbc3d9621583e9527d9cf76f2274d1d9da14 /Source/DafnyExtension
parent962a78676767259bb40eb3e602974bd3c05a6589 (diff)
DafnyExtension: minor change
Diffstat (limited to 'Source/DafnyExtension')
-rw-r--r--Source/DafnyExtension/DafnyDriver.cs4
-rw-r--r--Source/DafnyExtension/ProgressMargin.cs11
-rw-r--r--Source/DafnyExtension/ResolverTagger.cs6
3 files changed, 11 insertions, 10 deletions
diff --git a/Source/DafnyExtension/DafnyDriver.cs b/Source/DafnyExtension/DafnyDriver.cs
index 8c0f3235..eadf24e3 100644
--- a/Source/DafnyExtension/DafnyDriver.cs
+++ b/Source/DafnyExtension/DafnyDriver.cs
@@ -114,9 +114,9 @@ namespace DafnyLanguage
return true; // success
}
- void RecordError(string filename, int line, int col, ErrorCategory cat, string msg)
+ void RecordError(string filename, int line, int col, ErrorCategory cat, string msg, bool isRecycled = false)
{
- _errors.Add(new DafnyError(filename, line, col, cat, msg, _snapshot, null, System.IO.Path.GetFullPath(this._filename) == filename));
+ _errors.Add(new DafnyError(filename, line, col, cat, msg, _snapshot, isRecycled, null, System.IO.Path.GetFullPath(this._filename) == filename));
}
class VSErrors : Dafny.Errors
diff --git a/Source/DafnyExtension/ProgressMargin.cs b/Source/DafnyExtension/ProgressMargin.cs
index c345257e..20cbecd1 100644
--- a/Source/DafnyExtension/ProgressMargin.cs
+++ b/Source/DafnyExtension/ProgressMargin.cs
@@ -340,10 +340,11 @@ namespace DafnyLanguage
if (!_disposed)
{
errorInfo.BoogieErrorCode = null;
- var recycled = errorInfo.OriginalRequestId != requestId ? " (recycled)" : "";
+ var isRecycled = false;
ITextSnapshot s = null;
if (errorInfo.OriginalRequestId != null)
{
+ isRecycled = errorInfo.OriginalRequestId != requestId;
RequestIdToSnapshot.TryGetValue(errorInfo.OriginalRequestId, out s);
}
if (s == null && errorInfo.RequestId != null)
@@ -352,22 +353,22 @@ namespace DafnyLanguage
}
if (s != null)
{
- errorListHolder.AddError(new DafnyError(errorInfo.Tok.filename, errorInfo.Tok.line - 1, errorInfo.Tok.col - 1, ErrorCategory.VerificationError, errorInfo.FullMsg + recycled, s, errorInfo.Model.ToString(), System.IO.Path.GetFullPath(_document.FilePath) == errorInfo.Tok.filename), errorInfo.ImplementationName, requestId);
+ errorListHolder.AddError(new DafnyError(errorInfo.Tok.filename, errorInfo.Tok.line - 1, errorInfo.Tok.col - 1, ErrorCategory.VerificationError, errorInfo.FullMsg, s, isRecycled, errorInfo.Model.ToString(), System.IO.Path.GetFullPath(_document.FilePath) == errorInfo.Tok.filename), errorInfo.ImplementationName, requestId);
foreach (var aux in errorInfo.Aux)
{
- errorListHolder.AddError(new DafnyError(aux.Tok.filename, aux.Tok.line - 1, aux.Tok.col - 1, ErrorCategory.AuxInformation, aux.FullMsg, s, null, System.IO.Path.GetFullPath(_document.FilePath) == aux.Tok.filename), errorInfo.ImplementationName, requestId);
+ errorListHolder.AddError(new DafnyError(aux.Tok.filename, aux.Tok.line - 1, aux.Tok.col - 1, ErrorCategory.AuxInformation, aux.FullMsg, s, isRecycled, null, System.IO.Path.GetFullPath(_document.FilePath) == aux.Tok.filename), errorInfo.ImplementationName, requestId);
}
}
}
});
if (!success)
{
- errorListHolder.AddError(new DafnyError("$$program$$", 0, 0, ErrorCategory.InternalError, "Verification process error", snapshot), "$$program$$", requestId);
+ errorListHolder.AddError(new DafnyError("$$program$$", 0, 0, ErrorCategory.InternalError, "Verification process error", snapshot, false), "$$program$$", requestId);
}
}
catch (Exception e)
{
- errorListHolder.AddError(new DafnyError("$$program$$", 0, 0, ErrorCategory.InternalError, "Verification process error: " + e.Message, snapshot), "$$program$$", requestId);
+ errorListHolder.AddError(new DafnyError("$$program$$", 0, 0, ErrorCategory.InternalError, "Verification process error: " + e.Message, snapshot, false), "$$program$$", requestId);
}
lock (this) {
diff --git a/Source/DafnyExtension/ResolverTagger.cs b/Source/DafnyExtension/ResolverTagger.cs
index df7878c4..bbe51665 100644
--- a/Source/DafnyExtension/ResolverTagger.cs
+++ b/Source/DafnyExtension/ResolverTagger.cs
@@ -327,7 +327,7 @@ namespace DafnyLanguage
}
catch (Exception e)
{
- newErrors = new List<DafnyError> { new DafnyError(filename, 0, 0, ErrorCategory.InternalError, "internal Dafny error: " + e.Message, snapshot) };
+ newErrors = new List<DafnyError> { new DafnyError(filename, 0, 0, ErrorCategory.InternalError, "internal Dafny error: " + e.Message, snapshot, false) };
program = null;
}
@@ -575,13 +575,13 @@ namespace DafnyLanguage
/// <summary>
/// "line" and "col" are expected to be 0-based
/// </summary>
- public DafnyError(string filename, int line, int col, ErrorCategory cat, string msg, ITextSnapshot snapshot, string model = null, bool inCurrentDocument=true)
+ public DafnyError(string filename, int line, int col, ErrorCategory cat, string msg, ITextSnapshot snapshot, bool isRecycled, string model = null, bool inCurrentDocument = true)
{
Filename = filename;
Line = Math.Max(0, line);
Column = Math.Max(0, col);
Category = cat;
- Message = msg;
+ Message = msg + ((isRecycled && cat == ErrorCategory.VerificationError) ? " (recycled)" : "");
Snapshot = snapshot;
if (inCurrentDocument) {
var sLine = snapshot.GetLineFromLineNumber(line);