blob: 9dd5bb5aa5fe6cdd7d6d145696f48fc7fabaca0a [file] [edit]
import Lean
/-! Pretty printing tests for `Expr`s that cannot be generated by parsing+elaborating. -/
open Lean
def test (e : Expr) : MetaM Unit := do
IO.println (← PrettyPrinter.ppExpr e)
-- loose bound variable
#eval test (mkBVar 0)
-- anonymous binder
#eval test (mkLambda Name.anonymous BinderInfo.default (mkSort Level.zero) (mkBVar 0))
-- pp annotations
#eval test $
mkAppN (mkConst `id [Level.one]) #[
mkConst `Nat,
mkMData (KVMap.empty.set `pp.explicit true) $ mkAppN (mkConst `id [Level.one]) #[
mkConst `Nat,
mkAppN (mkConst `id [Level.one]) #[
mkConst `Nat,
mkConst `Nat.zero
]]]