chore: More code cleanup
This commit is contained in:
parent
678cc9b3c0
commit
cb1082c7c7
|
@ -68,7 +68,7 @@ def _root_.Lean.Name.isAuxLemma (n : Lean.Name) : Bool := n matches .num (.str _
|
||||||
/-- Unfold all lemmas created by `Lean.Meta.mkAuxLemma`. These end in `_auxLemma.nn` where `nn` is a number. -/
|
/-- Unfold all lemmas created by `Lean.Meta.mkAuxLemma`. These end in `_auxLemma.nn` where `nn` is a number. -/
|
||||||
@[export pantograph_unfold_aux_lemmas_m]
|
@[export pantograph_unfold_aux_lemmas_m]
|
||||||
def unfoldAuxLemmas : Expr → CoreM Expr :=
|
def unfoldAuxLemmas : Expr → CoreM Expr :=
|
||||||
(Lean.Meta.deltaExpand · Lean.Name.isAuxLemma)
|
(Meta.deltaExpand · Lean.Name.isAuxLemma)
|
||||||
/-- Unfold all matcher applications -/
|
/-- Unfold all matcher applications -/
|
||||||
@[export pantograph_unfold_matchers_m]
|
@[export pantograph_unfold_matchers_m]
|
||||||
def unfoldMatchers (expr : Expr) : CoreM Expr :=
|
def unfoldMatchers (expr : Expr) : CoreM Expr :=
|
||||||
|
@ -97,7 +97,7 @@ This function ensures any metavariable in the result is either
|
||||||
partial def instantiateDelayedMVars (expr : Expr) : MetaM Expr :=
|
partial def instantiateDelayedMVars (expr : Expr) : MetaM Expr :=
|
||||||
withTraceNode `Pantograph.Delate (λ _ex => return m!":= {← Meta.ppExpr expr}") do
|
withTraceNode `Pantograph.Delate (λ _ex => return m!":= {← Meta.ppExpr expr}") do
|
||||||
let mut result ← Meta.transform (← instantiateMVars expr)
|
let mut result ← Meta.transform (← instantiateMVars expr)
|
||||||
(pre := fun e => e.withApp fun f args => do
|
λ e => e.withApp fun f args => do
|
||||||
let .mvar mvarId := f | return .continue
|
let .mvar mvarId := f | return .continue
|
||||||
trace[Pantograph.Delate] "V {e}"
|
trace[Pantograph.Delate] "V {e}"
|
||||||
let mvarDecl ← mvarId.getDecl
|
let mvarDecl ← mvarId.getDecl
|
||||||
|
@ -156,7 +156,7 @@ partial def instantiateDelayedMVars (expr : Expr) : MetaM Expr :=
|
||||||
trace[Pantograph.Delate] "─ Arguments End"
|
trace[Pantograph.Delate] "─ Arguments End"
|
||||||
|
|
||||||
trace[Pantograph.Delate] "M ?{mvarId.name}"
|
trace[Pantograph.Delate] "M ?{mvarId.name}"
|
||||||
return .done (mkAppN f args))
|
return .done (mkAppN f args)
|
||||||
trace[Pantoraph.Delate] "Result {result}"
|
trace[Pantoraph.Delate] "Result {result}"
|
||||||
return result
|
return result
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in New Issue