- env : Lean.Environment
- mctx : Lean.MetavarContext
- lctx : Lean.LocalContext
- opts : Lean.Options
- currNamespace : Lean.Name
- openDecls : List Lean.OpenDecl
- ppExpr : Lean.PPContext → Lean.Expr → IO Lean.Format
- ppTerm : Lean.PPContext → Lean.Syntax → IO Lean.Format
- ppGoal : Lean.PPContext → Lean.MVarId → IO Lean.Format
Equations
- Lean.instInhabitedPPFns = { default := { ppExpr := default, ppTerm := default, ppGoal := default } }
Equations
- Lean.ppExpr ctx e = let e := (Lean.MetavarContext.instantiateMVars ctx.mctx e).fst; if Lean.Option.get ctx.opts Lean.pp.raw = true then pure (Lean.format (toString e)) else tryCatch (Lean.PPFns.ppExpr (Lean.EnvExtension.getState Lean.ppExt ctx.env) ctx e) fun ex => if Lean.Option.get ctx.opts Lean.pp.rawOnError = true then pure (Lean.format "[Error pretty printing expression: " ++ Lean.format ex ++ Lean.format ". Falling back to raw printer.]" ++ Lean.format Lean.Format.line ++ Lean.format "" ++ Lean.format e ++ Lean.format "") else pure (Lean.format "failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation)")
Equations
- Lean.ppTerm ctx stx = let fmtRaw := fun x => Lean.Syntax.formatStx stx (some (Lean.Option.get ctx.opts Lean.pp.raw.maxDepth)) (Lean.Option.get ctx.opts Lean.pp.raw.showInfo); if Lean.Option.get ctx.opts Lean.pp.raw = true then pure (fmtRaw ()) else tryCatch (Lean.PPFns.ppTerm (Lean.EnvExtension.getState Lean.ppExt ctx.env) ctx stx) fun ex => if Lean.Option.get ctx.opts Lean.pp.rawOnError = true then pure (Lean.format "[Error pretty printing syntax: " ++ Lean.format ex ++ Lean.format ". Falling back to raw printer.]" ++ Lean.format Lean.Format.line ++ Lean.format "" ++ Lean.format (fmtRaw ()) ++ Lean.format "") else pure (Lean.format "failed to pretty print term (use 'set_option pp.rawOnError true' for raw representation)")
Equations
- Lean.ppGoal ctx mvarId = Lean.PPFns.ppGoal (Lean.EnvExtension.getState Lean.ppExt ctx.env) ctx mvarId