This PR adds the options `pp.piBinderNames` and `pp.piBinderNames.hygienic`. Enabling `pp.piBinderNames` causes non-dependent pi binder names to be pretty printed, rather than be omitted. When `pp.piBinderNames.hygienic` is false (the default) then only non-hygienic such biner names are pretty printed. Setting `pp.all` enables `pp.piBinderNames` if it is not otherwise explicitly set. Implementation note: this is exposing the secret pretty printer option `pp.piBinderNames` that was being used within the signature pretty printer. Closes #1134.
97 lines
1.6 KiB
Text
97 lines
1.6 KiB
Text
/-!
|
|
# Testing pretty printing option `pp.piBinderNames`
|
|
-/
|
|
|
|
/-!
|
|
Tests of default options.
|
|
-/
|
|
section
|
|
|
|
/-!
|
|
Unused name, doesn't print.
|
|
-/
|
|
/-- info: Nat → Type : Type 1 -/
|
|
#guard_msgs in #check (x : Nat) → Type
|
|
|
|
/-!
|
|
Unused hygienic name, doesn't print.
|
|
-/
|
|
/-- info: Nat → Type : Type 1 -/
|
|
#guard_msgs in #check Nat → Type
|
|
|
|
end
|
|
|
|
/-!
|
|
Tests with `pp.piBinderNames` enabled.
|
|
-/
|
|
section
|
|
set_option pp.piBinderNames true
|
|
|
|
/-!
|
|
Unused name, prints since not hygienic.
|
|
-/
|
|
/-- info: (x : Nat) → Type : Type 1 -/
|
|
#guard_msgs in #check (x : Nat) → Type
|
|
|
|
/-!
|
|
Unused hygienic name, doesn't print.
|
|
-/
|
|
/-- info: Nat → Type : Type 1 -/
|
|
#guard_msgs in #check Nat → Type
|
|
|
|
end
|
|
|
|
/-!
|
|
Tests with `pp.piBinderNames` and `pp.piBinderNames.hygienic` enabled.
|
|
-/
|
|
section
|
|
set_option pp.piBinderNames true
|
|
set_option pp.piBinderNames.hygienic true
|
|
|
|
/-!
|
|
Prints unused name.
|
|
-/
|
|
/-- info: (x : Nat) → Type : Type 1 -/
|
|
#guard_msgs in #check (x : Nat) → Type
|
|
|
|
/-!
|
|
Prints unused hygienic name.
|
|
-/
|
|
/-- info: (a : Nat) → Type : Type 1 -/
|
|
#guard_msgs in #check Nat → Type
|
|
|
|
end
|
|
|
|
/-!
|
|
Tests with `pp.all`. Enables `pp.piBinderNames`.
|
|
-/
|
|
section
|
|
set_option pp.all true
|
|
|
|
/-!
|
|
Unused name, prints since not hygienic.
|
|
-/
|
|
/-- info: (x : Nat) → Type : Type 1 -/
|
|
#guard_msgs in #check (x : Nat) → Type
|
|
|
|
/-!
|
|
Unused hygienic name, doesn't print.
|
|
-/
|
|
/-- info: Nat → Type : Type 1 -/
|
|
#guard_msgs in #check Nat → Type
|
|
|
|
set_option pp.piBinderNames.hygienic true
|
|
|
|
/-!
|
|
Prints unused name.
|
|
-/
|
|
/-- info: (x : Nat) → Type : Type 1 -/
|
|
#guard_msgs in #check (x : Nat) → Type
|
|
|
|
/-!
|
|
Prints unused hygienic name.
|
|
-/
|
|
/-- info: (a : Nat) → Type : Type 1 -/
|
|
#guard_msgs in #check Nat → Type
|
|
|
|
end
|