Parse and format top-level import defs with no alias or exposed members

This commit is contained in:
Agus Zubiaga 2023-11-29 09:52:20 -03:00
parent ebfcd71e8d
commit 933fde77a0
No known key found for this signature in database
12 changed files with 117 additions and 25 deletions

View file

@ -455,6 +455,11 @@ pub enum ValueDef<'a> {
condition: &'a Loc<Expr<'a>>,
preceding_comment: Region,
},
/// e.g. `import [Req] as Http from InternalHttp`.
ModuleImport {
name: Loc<crate::header::ModuleName<'a>>,
},
}
#[derive(Debug, Clone, PartialEq, Default)]
@ -1792,6 +1797,7 @@ impl<'a> Malformed for ValueDef<'a> {
condition,
preceding_comment: _,
} => condition.is_malformed(),
ValueDef::ModuleImport { name } => name.value.contains_dot(),
}
}
}