lean4-htt/tests/lean/run/ppUsingAnonymousConstructor.lean
Kyle Miller ff7a0db099
feat: add pp_using_anonymous_constructor attribute (#3640)
Implements a Lean 3 pretty printer feature. Structures with the
`@[pp_using_anonymous_constructor]` attribute pretty using anonymous
constructor notation (`⟨x, y, z⟩`) rather than structure instance
notation (`{a := x, b := y, c := z}`).

[Zulip
discussion](https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/.60pp_using_anonymous_constructor.60/near/425705445)
2024-03-21 23:01:10 +00:00

17 lines
321 B
Text

/-!
# Tests for the `pp_using_anonymous_constructor` attribute
-/
/-!
Custom structure
-/
structure S where
(x y : Nat)
/-- info: { x := 1, y := 2 } : S -/
#guard_msgs in #check {x := 1, y := 2 : S}
attribute [pp_using_anonymous_constructor] S
/-- info: ⟨1, 2⟩ : S -/
#guard_msgs in #check {x := 1, y := 2 : S}