Keep expanded form when pretty printings variable declarations with implicit marks (i.e., curly braces)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
df116f88e0
commit
59a589037e
2 changed files with 21 additions and 29 deletions
|
@ -856,16 +856,9 @@ class pp_fn {
|
|||
++it2;
|
||||
bool implicit = is_implicit(implicit_args, arg_pos);
|
||||
++arg_pos;
|
||||
if (!implicit && !is_lambda(e) && arg_pos > arrow_starting_at) {
|
||||
// the rest is an arrow, but we must check if we are not missing implicit annotations.
|
||||
auto it2_aux = it2;
|
||||
unsigned arg_pos_aux = arg_pos;
|
||||
while (it2_aux != end && !is_implicit(implicit_args, arg_pos_aux)) {
|
||||
++arg_pos_aux;
|
||||
++it2_aux;
|
||||
}
|
||||
if (it2_aux == end) {
|
||||
// the rest is a sequence of arrows.
|
||||
if (!implicit_args && arg_pos > arrow_starting_at) {
|
||||
// The rest is an arrow
|
||||
// We do not use arrow pp when implicit_args marks are used.
|
||||
format block;
|
||||
bool first_domain = true;
|
||||
for (; it != end; ++it) {
|
||||
|
@ -885,7 +878,6 @@ class pp_fn {
|
|||
format r_format = group(nest(head_indent, format{head, space(), group(bindings), body_sep, line(), block}));
|
||||
return mk_result(r_format, r_weight);
|
||||
}
|
||||
}
|
||||
// Continue with standard encoding
|
||||
while (it2 != end && it2->second == it->second && implicit == is_implicit(implicit_args, arg_pos)) {
|
||||
++it2;
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
Assumed: R
|
||||
Proved: R2
|
||||
Set: lean::pp::implicit
|
||||
Variable C {A B : Type} : (A = B) → A → B
|
||||
Variable C {A B : Type} (H : A = B) (a : A) : B
|
||||
Definition C::explicit (A B : Type) (H : A = B) (a : A) : B := C H a
|
||||
Variable D {A A' : Type} {B : A → Type} {B' : A' → Type} : ((Π x : A, B x) = (Π x : A', B' x)) → (A = A')
|
||||
Variable D {A A' : Type} {B : A → Type} {B' : A' → Type} (H : (Π x : A, B x) = (Π x : A', B' x)) : A = A'
|
||||
Definition D::explicit (A A' : Type) (B : A → Type) (B' : A' → Type) (H : (Π x : A, B x) = (Π x : A', B' x)) : A =
|
||||
A' :=
|
||||
D H
|
||||
|
|
Loading…
Reference in a new issue