-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #781 PG does not position to error.
Tests is also added to check the exact position of the error highlighting. Description of the fix. We cannot use the " ^^^ " thing to compute the error location because commands are not stripped of newlines anymore (#774). Solution: use the character position information given in the error message with the following subtleties: - position are given by coq **bytes** positions. - position given by coq is the position from the previous "." fed to coq. I.e. we must be careful to strip any blank after the final "." of a command. - Coq < 8.11 has a small glitch on positions, the test is compatible with both behaviour. - coq <= 8.20 has a bug on position for curly braces. In the test we make the disappearing timeout of overlay bigger so that tests don't fail on slow VMs (maybe useless). NOTE: coq error locations are quite wrong when we insert spaces (instead of a newline) after a command. PG was wrongly inserting a space after Set Silent./ Unset Silent, which triggered this problem. This is fixed by this PR. But other silent commends should triped of trailing blanks. I leave it to another PR.
- Loading branch information
Showing
3 changed files
with
138 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Lemma false_proof : forall A B : bool, A = B. | ||
Proof. | ||
intros A B. | ||
destruct A. | ||
destruct B. | ||
reflexivity. (*error*) | ||
} | ||
Qed. (*test-lemma*) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters