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)
17 lines
321 B
Text
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}
|