feat: add Meta.ppExpr

This commit is contained in:
Leonardo de Moura 2020-09-10 17:27:14 -07:00
parent c3d91e4228
commit f28def6c5e

View file

@ -9,6 +9,7 @@ import Lean.Class
import Lean.ReducibilityAttrs
import Lean.Util.Trace
import Lean.Util.RecDepth
import Lean.Util.PPExt
import Lean.Compiler.InlineAttrs
import Lean.Meta.Exception
import Lean.Meta.TransparencyMode
@ -958,6 +959,16 @@ def dependsOn (e : Expr) (fvarId : FVarId) : m Bool := liftMetaM do
mctx ← getMCtx;
pure $ mctx.exprDependsOn e fvarId
def ppExprImp (e : Expr) : MetaM Format := do
env ← getEnv;
mctx ← getMCtx;
lctx ← getLCtx;
opts ← getOptions;
pure $ Lean.ppExpr env mctx lctx opts e
def ppExpr (e : Expr) : m Format :=
liftMetaM $ ppExprImp e
end Methods
end Meta