diff options
| author | Pierre-Marie Pédrot | 2018-04-30 09:39:56 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2018-04-30 09:39:56 +0200 |
| commit | c1e12fbc64c39739e4a9f7bbf92e42f1bcb6be24 (patch) | |
| tree | 3ae4ffb92eab12be9e33fad5a5ff0687c6cff540 /proofs | |
| parent | 86cfc249dc7cc95d772ed91663491ee8b37c1431 (diff) | |
| parent | d94fef210a63db4ff34251afe093041912a7cbde (diff) | |
Merge PR #6944: Strict focusing using Default Goal Selector.
Diffstat (limited to 'proofs')
| -rw-r--r-- | proofs/pfedit.ml | 12 | ||||
| -rw-r--r-- | proofs/proof_bullet.ml | 4 |
2 files changed, 15 insertions, 1 deletions
diff --git a/proofs/pfedit.ml b/proofs/pfedit.ml index abda04ff1b..62a38fa325 100644 --- a/proofs/pfedit.ml +++ b/proofs/pfedit.ml @@ -101,6 +101,18 @@ let solve ?with_end_tac gi info_lvl tac pr = | Some _ -> Proofview.Trace.record_info_trace tac in let tac = match gi with + | Vernacexpr.SelectAlreadyFocused -> + let open Proofview.Notations in + Proofview.numgoals >>= fun n -> + if n == 1 then tac + else + let e = CErrors.UserError + (None, + Pp.(str "Expected a single focused goal but " ++ + int n ++ str " goals are focused.")) + in + Proofview.tclZERO e + | Vernacexpr.SelectNth i -> Proofview.tclFOCUS i i tac | Vernacexpr.SelectList l -> Proofview.tclFOCUSLIST l tac | Vernacexpr.SelectId id -> Proofview.tclFOCUSID id tac diff --git a/proofs/proof_bullet.ml b/proofs/proof_bullet.ml index e22d382f7d..d6f7c0e93a 100644 --- a/proofs/proof_bullet.ml +++ b/proofs/proof_bullet.ml @@ -212,6 +212,7 @@ let pr_range_selector (i, j) = else Pp.(int i ++ str "-" ++ int j) let pr_goal_selector = function + | Vernacexpr.SelectAlreadyFocused -> Pp.str "!" | Vernacexpr.SelectAll -> Pp.str "all" | Vernacexpr.SelectNth i -> Pp.int i | Vernacexpr.SelectList l -> @@ -221,9 +222,10 @@ let pr_goal_selector = function | Vernacexpr.SelectId id -> Names.Id.print id let parse_goal_selector = function + | "!" -> Vernacexpr.SelectAlreadyFocused | "all" -> Vernacexpr.SelectAll | i -> - let err_msg = "The default selector must be \"all\" or a natural number." in + let err_msg = "The default selector must be \"all\" or \"!\" or a natural number." in begin try let i = int_of_string i in if i < 0 then CErrors.user_err Pp.(str err_msg); |
