feat(frontends/lean/parser): include proof state in exception for tactic failure

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-12-20 17:15:12 -08:00
parent 84df182beb
commit bb81311e0a
3 changed files with 6 additions and 2 deletions

View file

@ -1709,8 +1709,8 @@ class parser::imp {
}
switch (st) {
case status::Done: return *pr;
case status::Eof: throw parser_error("invalid tactic command, unexpected end of file", pos());
case status::Abort: throw parser_error("failed to prove theorem, proof has been aborted", pos());
case status::Eof: throw tactic_cmd_error("invalid tactic command, unexpected end of file", pos(), s);
case status::Abort: throw tactic_cmd_error("failed to prove theorem, proof has been aborted", pos(), s);
default: lean_unreachable(); // LCOV_EXCL_LINE
}
}

View file

@ -15,4 +15,6 @@ no goals
## Proof state:
A : Bool, B : Bool, H : A ∧ B, H1 : A, H2 : B ⊢ B ∧ A
## Error (line: 18, pos: 0) failed to prove theorem, proof has been aborted
Proof state:
A : Bool, B : Bool, H : A ∧ B, H1 : A, H2 : B ⊢ B ∧ A
# echo command after failure

View file

@ -11,6 +11,8 @@ H : a, a : Bool, b : Bool ⊢ b ⇒ a ∧ b
## Proof state:
H::1 : b, H : a, a : Bool, b : Bool ⊢ a ∧ b
## Error (line: 9, pos: 5) failed to prove theorem, proof has been aborted
Proof state:
H::1 : b, H : a, a : Bool, b : Bool ⊢ a ∧ b
# Assumed: a
Assumed: b
# Variable a : Bool