Skip to content

Commit 703b963

Browse files
committed
chore: make some extCore and customEliminators public for Batteries
1 parent 2f93363 commit 703b963

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/Lean/Elab/Tactic/Ext.lean

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import Lean.Elab.Tactic.Repeat
1313
import Lean.Elab.Tactic.BuiltinTactic
1414
import Lean.Elab.Command
1515
import Lean.Linter.Basic
16+
-- These public imports are needed because for now we make `extCore` public.
17+
public import Lean.Expr
18+
public import Lean.Elab.Term.TermElabM
1619

1720
/-!
1821
# Implementation of the `@[ext]` attribute
@@ -296,7 +299,8 @@ in extensionality theorems like `funext`. Returns a list of subgoals.
296299
This is built on top of `withExtN`, running in `TermElabM` to build the list of new subgoals.
297300
(And, for each goal, the patterns consumed.)
298301
-/
299-
def extCore (g : MVarId) (pats : List (TSyntax `rcasesPat))
302+
-- This is public as it is used in the implementation of `rcongr` in Batteries.
303+
public def extCore (g : MVarId) (pats : List (TSyntax `rcasesPat))
300304
(depth := 100) (failIfUnchanged := true) :
301305
TermElabM (Nat × Array (MVarId × List (TSyntax `rcasesPat))) := do
302306
StateT.run (m := TermElabM) (s := #[])

src/Lean/Elab/Tactic/Induction.lean

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ import Lean.Elab.App
2323
import Lean.Elab.Match
2424
import Lean.Elab.Tactic.Generalize
2525

26+
public section
27+
28+
register_builtin_option tactic.customEliminators : Bool := {
29+
defValue := true
30+
group := "tactic"
31+
descr := "enable using custom eliminators in the 'induction' and 'cases' tactics \
32+
defined using the '@[induction_eliminator]' and '@[cases_eliminator]' attributes"
33+
}
34+
35+
end
36+
2637
namespace Lean.Elab.Tactic
2738
open Meta
2839

@@ -776,13 +787,6 @@ def elabTermForElim (stx : Syntax) : TermElabM Expr := do
776787
else
777788
return e
778789

779-
register_builtin_option tactic.customEliminators : Bool := {
780-
defValue := true
781-
group := "tactic"
782-
descr := "enable using custom eliminators in the 'induction' and 'cases' tactics \
783-
defined using the '@[induction_eliminator]' and '@[cases_eliminator]' attributes"
784-
}
785-
786790
-- `optElimId` is of the form `("using" term)?`
787791
def getElimNameInfo (optElimId : Syntax) (targets : Array Expr) (induction : Bool) : TacticM ElimInfo := do
788792
let getBaseName? (elimName : Name) : MetaM (Option Name) := do

0 commit comments

Comments
 (0)