@@ -244,35 +244,29 @@ private def elabGrindConfig' (config : TSyntax ``Lean.Parser.Tactic.optConfig) (
244244@[builtin_tactic Lean.Parser.Tactic.grind] def evalGrind : Tactic := fun stx => do
245245 -- Preserve this import in core; all others import `Init` anyway
246246 recordExtraModUse (isMeta := false ) `Init.Grind.Tactics
247- match stx with
248- | `(tactic| grind $config:optConfig $[only%$only]? $[ [$params:grindParam,*] ]? $[=> $seq:grindSeq]?) =>
249- let interactive := seq.isSome
250- let config ← elabGrindConfig' config interactive
251- discard <| evalGrindCore stx config only params seq
252- | _ => throwUnsupportedSyntax
247+ let `(tactic| grind $config:optConfig $[only%$only]? $[ [$params:grindParam,*] ]? $[=> $seq:grindSeq]?) := stx
248+ | throwUnsupportedSyntax
249+ let interactive := seq.isSome
250+ let config ← elabGrindConfig' config interactive
251+ discard <| evalGrindCore stx config only params seq
253252
254253@[builtin_tactic Lean.Parser.Tactic.grindTrace] def evalGrindTrace : Tactic := fun stx => do
255- match stx with
256- | `(tactic| grind?%$tk $configStx:optConfig $[only%$only]? $[ [$params:grindParam,*] ]?) =>
257- let config ← elabGrindConfig configStx
258- let config := { config with trace := true }
259- let trace ← evalGrindCore stx config only params none
260- let stx ← mkGrindOnly configStx trace
261- Tactic.TryThis.addSuggestion tk stx (origSpan? := ← getRef)
262- | _ => throwUnsupportedSyntax
254+ let `(tactic| grind?%$tk $configStx:optConfig $[only%$only]? $[ [$params:grindParam,*] ]?) := stx
255+ | throwUnsupportedSyntax
256+ let config ← elabGrindConfig configStx
257+ let config := { config with trace := true }
258+ let trace ← evalGrindCore stx config only params none
259+ let stx ← mkGrindOnly configStx trace
260+ Tactic.TryThis.addSuggestion tk stx (origSpan? := ← getRef)
263261
264262@[builtin_tactic Lean.Parser.Tactic.cutsat] def evalCutsat : Tactic := fun stx => do
265- match stx with
266- | `(tactic| cutsat $config:optConfig) =>
267- let config ← elabCutsatConfig config
268- discard <| evalGrindCore stx { config with } none none none
269- | _ => throwUnsupportedSyntax
263+ let `(tactic| cutsat $config:optConfig) := stx | throwUnsupportedSyntax
264+ let config ← elabCutsatConfig config
265+ discard <| evalGrindCore stx { config with } none none none
270266
271267@[builtin_tactic Lean.Parser.Tactic.grobner] def evalGrobner : Tactic := fun stx => do
272- match stx with
273- | `(tactic| grobner $config:optConfig) =>
274- let config ← elabGrobnerConfig config
275- discard <| evalGrindCore stx { config with } none none none
276- | _ => throwUnsupportedSyntax
268+ let `(tactic| grobner $config:optConfig) := stx | throwUnsupportedSyntax
269+ let config ← elabGrobnerConfig config
270+ discard <| evalGrindCore stx { config with } none none none
277271
278272end Lean.Elab.Tactic
0 commit comments