aboutsummaryrefslogtreecommitdiff
path: root/user-contrib
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2021-03-24 11:19:13 +0100
committerPierre-Marie Pédrot2021-03-24 11:19:13 +0100
commite80d2ddc7db13c861c865ed5acf7708f99f125ec (patch)
treeaaf168349be1f96c05ccd9b89bfb16c1159c8b6f /user-contrib
parent47c20236f578dca9381822a62b5a406d6b42676d (diff)
parentcbe88ec043df8dff118e437f00c0299a464c8e8a (diff)
Merge PR #13973: Factorize goal selector handling
Reviewed-by: ppedrot
Diffstat (limited to 'user-contrib')
-rw-r--r--user-contrib/Ltac2/tac2entries.ml21
1 files changed, 4 insertions, 17 deletions
diff --git a/user-contrib/Ltac2/tac2entries.ml b/user-contrib/Ltac2/tac2entries.ml
index 0aa05934bf..d2e74609a2 100644
--- a/user-contrib/Ltac2/tac2entries.ml
+++ b/user-contrib/Ltac2/tac2entries.ml
@@ -841,24 +841,11 @@ let perform_eval ~pstate e =
Goal_select.get_default_goal_selector (),
Declare.Proof.get pstate
in
- let v = match selector with
- | Goal_select.SelectNth i -> Proofview.tclFOCUS i i v
- | Goal_select.SelectList l -> Proofview.tclFOCUSLIST l v
- | Goal_select.SelectId id -> Proofview.tclFOCUSID id v
- | Goal_select.SelectAll -> v
- | 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
+ let nosuchgoal =
+ let info = Exninfo.reify () in
+ Proofview.tclZERO ~info (Proof.SuggestNoSuchGoals (1,proof))
in
+ let v = Goal_select.tclSELECT ~nosuchgoal selector v in
let (proof, _, ans) = Proof.run_tactic (Global.env ()) v proof in
let { Proof.sigma } = Proof.data proof in
let name = int_name () in