forked from leanprover/lean4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Setting `pp.mvars` to false causes metavariables to pretty print as `?_`. * Setting `pp.mvars.withType` to true causes metavariables to pretty print with type ascriptions. Motivation: when making tests, it is inconvenient using `#guard_msgs` when there are metavariables, since the unique numbering is subject to change. This feature does not use `⋯` omissions since a metavariable is already in a sense an omitted term. If repeated metavariables do not appear in an expression, there is a chance that a term pretty printed with `pp.mvars` set to false can still elaborate to the correct term, unlike for other omissions. (In the future we could consider an option that pretty prints uniquely numbered metavariables as `?m✝`, `?m✝¹`, `?m✝²`, etc. to be able to tell them apart, at least in the same pretty printed expression. It would take care to make sure that these names are stable across different hovers.) Closes leanprover#3781
- Loading branch information
Showing
5 changed files
with
79 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/-! | ||
# Testing `pp.mvars` | ||
-/ | ||
|
||
/-! | ||
Default values | ||
-/ | ||
|
||
/-- info: ?a : Nat -/ | ||
#guard_msgs in #check (?a : Nat) | ||
|
||
/-! | ||
Turning off `pp.mvars` | ||
-/ | ||
section | ||
set_option pp.mvars false | ||
|
||
/-- info: ?_ : Nat -/ | ||
#guard_msgs in #check (?a : Nat) | ||
|
||
/-- info: ?_ : Nat -/ | ||
#guard_msgs in #check (_ : Nat) | ||
|
||
end | ||
|
||
/-! | ||
Turning off `pp.mvars` and turning on `pp.mvars.withType`. | ||
-/ | ||
section | ||
set_option pp.mvars false | ||
set_option pp.mvars.withType true | ||
|
||
/-- info: (?_ : Nat) : Nat -/ | ||
#guard_msgs in #check (?a : Nat) | ||
|
||
/-- info: (?_ : Nat) : Nat -/ | ||
#guard_msgs in #check (_ : Nat) | ||
|
||
end | ||
|
||
/-! | ||
Turning on `pp.mvars.withType`. | ||
-/ | ||
section | ||
set_option pp.mvars.withType true | ||
|
||
/-- info: (?a : Nat) : Nat -/ | ||
#guard_msgs in #check (?a : Nat) | ||
|
||
end |