use Defs in the parse::ast::Expr

This commit is contained in:
Folkert 2022-06-01 12:54:40 +02:00
parent 5d8bb105c5
commit ad9d06bd63
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
18 changed files with 105 additions and 335 deletions

View file

@ -1,6 +1,6 @@
use crate::annotation::{Formattable, Newlines, Parens};
use crate::collection::{fmt_collection, Braces};
use crate::def::fmt_def;
use crate::def::{fmt_def, fmt_toplevel_defs};
use crate::pattern::fmt_pattern;
use crate::spaces::{count_leading_newlines, fmt_comments_only, fmt_spaces, NewlineAt, INDENT};
use crate::Buf;
@ -322,9 +322,7 @@ impl<'a> Formattable for Expr<'a> {
// (Canonicalization can remove defs later, but that hasn't happened yet!)
debug_assert!(!defs.is_empty());
for loc_def in defs.iter() {
fmt_def(buf, &loc_def.value, indent);
}
fmt_toplevel_defs(buf, defs, indent);
match &ret.value {
SpaceBefore(sub_expr, spaces) => {