mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Parse and format aliases in import defs
This commit is contained in:
parent
933fde77a0
commit
76d799ea13
12 changed files with 85 additions and 6 deletions
|
@ -459,6 +459,7 @@ pub enum ValueDef<'a> {
|
|||
/// e.g. `import [Req] as Http from InternalHttp`.
|
||||
ModuleImport {
|
||||
name: Loc<crate::header::ModuleName<'a>>,
|
||||
alias: Option<Loc<crate::header::ModuleName<'a>>>,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -1797,7 +1798,9 @@ impl<'a> Malformed for ValueDef<'a> {
|
|||
condition,
|
||||
preceding_comment: _,
|
||||
} => condition.is_malformed(),
|
||||
ValueDef::ModuleImport { name } => name.value.contains_dot(),
|
||||
ValueDef::ModuleImport { name, alias } => {
|
||||
name.value.contains_dot() || alias.map_or(false, |x| x.value.contains_dot())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue