private static string ConvertToErrorType(DafnyError err) { // the COLORs below indicate what I see on my machine switch (err.Category) { case ErrorCategory.ProcessError: case ErrorCategory.ParseError: return("syntax error"); // COLOR: red case ErrorCategory.ResolveError: return("compiler error"); // COLOR: blue case ErrorCategory.ParseWarning: case ErrorCategory.ResolveWarning: return("compiler warning"); // COLOR: blue case ErrorCategory.InternalError: case ErrorCategory.VerificationError: return("error"); // COLOR: red case ErrorCategory.AuxInformation: return("other error"); // COLOR: purple red default: Contract.Assert(false); throw new InvalidOperationException(); } }
public DafnyErrorStateResolverTag(DafnyError error, ITrackingSpan span, int id, string description) { Error = error; Span = span; Id = id; Description = description; }
private static string ConvertToErrorType(DafnyError err) { string ty; // the COLORs below indicate what I see on my machine switch (err.Category) { default: // unexpected category case ErrorCategory.ParseError: case ErrorCategory.ParseWarning: ty = "syntax error"; break; // COLOR: red case ErrorCategory.ResolveError: ty = "compiler error"; break; // COLOR: blue case ErrorCategory.VerificationError: ty = "error"; break; // COLOR: red case ErrorCategory.AuxInformation: ty = "other error"; break; // COLOR: purple red case ErrorCategory.InternalError: ty = "error"; break; // COLOR: red } return(ty); }
internal void AddError(DafnyError error, string unitId, string requestId) { ErrorContainer entry; if (_verificationErrors.TryGetValue(unitId, out entry)) { lock (entry) { if (entry.RequestId == null || new DateTime(long.Parse(entry.RequestId)) < new DateTime(long.Parse(requestId))) { entry.Errors.Clear(); entry.RequestId = requestId; } } entry.Errors.Push(error); UpdateErrorList(Snapshot); } else if (unitId == "$$program_tactics$$") //These kinds of errors happen outside normal flow { entry = new ErrorContainer() { RequestId = requestId }; entry.Errors.Push(error); _verificationErrors.TryAdd(unitId, entry); } }
List <DafnyError> _resolutionErrors = new List <DafnyError>(); // if nonempty, then _snapshot is the snapshot from which the errors were produced internal void AddError(DafnyError error, string unitId, string requestId) { ErrorContainer entry; if (_verificationErrors.TryGetValue(unitId, out entry)) { lock (entry) { if (entry.RequestId == null || new DateTime(long.Parse(entry.RequestId)) < new DateTime(long.Parse(requestId))) { entry.Errors.Clear(); entry.RequestId = requestId; } } entry.Errors.Push(error); UpdateErrorList(Snapshot); } }
public DafnyErrorResolverTag(DafnyError error) : base(ConvertToErrorType(error), error.Message) { Error = error; }