diff options
| author | Pierre-Marie Pédrot | 2021-03-18 22:21:19 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2021-03-18 22:23:44 +0100 |
| commit | b809bf80bed06303f3d5aa2297787782a030f037 (patch) | |
| tree | d36666d59244fec29e968d3b0e2cd90efe94ea0a /user-contrib | |
| parent | eeef63b0b09cf90f7a3022ce6f0d7e50a908484c (diff) | |
Implement ! goal selector for Ltac2.
Fixes #13960: Ltac2 Eval does not work with Set Default Goal Selector "!".
Diffstat (limited to 'user-contrib')
| -rw-r--r-- | user-contrib/Ltac2/tac2entries.ml | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/user-contrib/Ltac2/tac2entries.ml b/user-contrib/Ltac2/tac2entries.ml index d0655890a7..faa1e74728 100644 --- a/user-contrib/Ltac2/tac2entries.ml +++ b/user-contrib/Ltac2/tac2entries.ml @@ -816,7 +816,18 @@ let perform_eval ~pstate e = | Goal_select.SelectList l -> Proofview.tclFOCUSLIST l v | Goal_select.SelectId id -> Proofview.tclFOCUSID id v | Goal_select.SelectAll -> v - | Goal_select.SelectAlreadyFocused -> assert false (* TODO **) + | Goal_select.SelectAlreadyFocused -> + let open Proofview.Notations in + Proofview.numgoals >>= fun n -> + if Int.equal n 1 then v + else + let e = CErrors.UserError + (None, + Pp.(str "Expected a single focused goal but " ++ + int n ++ str " goals are focused.")) + in + let info = Exninfo.reify () in + Proofview.tclZERO ~info e in let (proof, _, ans) = Proof.run_tactic (Global.env ()) v proof in let { Proof.sigma } = Proof.data proof in |
