private static void CheckAndAddDupe(DafnyError newErr, ICollection <DafnyError> oldErrs) { var x = (from e in oldErrs where e.Filename == newErr.Filename && e.Column == newErr.Column && e.Line == newErr.Line && e.Message == newErr.Message select e).FirstOrDefault(); if (x != null) { return; } oldErrs.Add(newErr); }
public void AddTacticErrors(List <DafnyError> existingErrors, ITextSnapshot snap, string file) { Contract.Requires(snap != null); Contract.Requires(existingErrors != null); Contract.Requires(!string.IsNullOrEmpty(file)); if (!(FoundCalling && FoundTactic)) { return; } var callingError = new DafnyError(file, CallingLine - 1, CallingCol - 1, ErrorCategory.TacticError, "Failing Call to " + _activeTactic, snap, true, ""); var actualError = new DafnyError(file, (FoundFailing ? FailingLine : TacticLine) - 1, (FoundFailing ? FailingCol : TacticCol) - 1, ErrorCategory.TacticError, _errMessage, snap, true, ""); CheckAndAddDupe(callingError, existingErrors); CheckAndAddDupe(actualError, existingErrors); }
private static void CheckAndAddDupe(DafnyError newErr, ICollection<DafnyError> oldErrs) { var x = (from e in oldErrs where e.Filename == newErr.Filename && e.Column == newErr.Column && e.Line == newErr.Line && e.Message == newErr.Message select e).FirstOrDefault(); if (x != null) return; oldErrs.Add(newErr); }
public void AddTacticErrors(List<DafnyError> existingErrors, ITextSnapshot snap, string file) { Contract.Requires(snap != null); Contract.Requires(existingErrors!=null); Contract.Requires(!string.IsNullOrEmpty(file)); if (!(FoundCalling && FoundTactic)) return; var callingError = new DafnyError(file, CallingLine - 1, CallingCol - 1, ErrorCategory.TacticError, "Failing Call to " + _activeTactic, snap, true, ""); var actualError = new DafnyError(file, (FoundFailing ? FailingLine : TacticLine) - 1, (FoundFailing ? FailingCol : TacticCol) - 1, ErrorCategory.TacticError, _errMessage, snap, true, ""); CheckAndAddDupe(callingError, existingErrors); CheckAndAddDupe(actualError, existingErrors); }