mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-15 08:15:07 +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
|
@ -844,11 +844,24 @@ fn import<'a>() -> impl Parser<'a, ValueDef<'a>, EImport> {
|
|||
crate::parser::keyword_e(crate::keyword::IMPORT, EImport::Import),
|
||||
spaces()
|
||||
),
|
||||
loc!(crate::module::module_name_help(EImport::ModuleName))
|
||||
and!(
|
||||
loc!(crate::module::module_name_help(EImport::ModuleName)),
|
||||
optional(backtrackable(skip_first!(
|
||||
and!(
|
||||
spaces(),
|
||||
and!(
|
||||
crate::parser::keyword_e(crate::keyword::AS, EImport::As),
|
||||
spaces()
|
||||
)
|
||||
),
|
||||
loc!(crate::module::module_name_help(EImport::Alias))
|
||||
)))
|
||||
)
|
||||
),
|
||||
|loc_module_name| {
|
||||
|(loc_module_name, optional_loc_alias)| {
|
||||
ValueDef::ModuleImport {
|
||||
name: loc_module_name,
|
||||
alias: optional_loc_alias,
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue