Skip to content

Commit

Permalink
chore: work around grind bootstrap issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed Jan 9, 2025
1 parent 32b737d commit fd41c69
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Lean/Elab/Tactic/Grind.lean
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ private def elabFallback (fallback? : Option Term) : TermElabM (Grind.GoalM Unit
pure auxDeclName
unsafe evalConst (Grind.GoalM Unit) auxDeclName

@[builtin_tactic Lean.Parser.Tactic.grind] def evalApplyRfl : Tactic := fun stx => do
match stx with
| `(tactic| grind $config:optConfig $[on_failure $fallback?]?) =>
let fallback ← elabFallback fallback?
logWarningAt stx "The `grind` tactic is experimental and still under development. Avoid using it in production projects"
let declName := (← Term.getDeclName?).getD `_grind
let config ← elabGrindConfig config
withMainContext do liftMetaFinishingTactic (grind · config declName fallback)
| _ => throwUnsupportedSyntax
@[builtin_tactic Lean.Parser.Tactic.grind] def evalGrind : Tactic := fun stx => do
-- grind $config:optConfig $[on_failure $fallback?]?
let config := stx[1]
let fallback? := guard (stx[2].getNumArgs == 2) *> pure (TSyntax.mk stx[2][1])
let fallback ← elabFallback fallback?
logWarningAt stx "The `grind` tactic is experimental and still under development. Avoid using it in production projects"
let declName := (← Term.getDeclName?).getD `_grind
let config ← elabGrindConfig config
withMainContext do liftMetaFinishingTactic (grind · config declName fallback)

end Lean.Elab.Tactic

0 comments on commit fd41c69

Please sign in to comment.