Skip to content

Commit

Permalink
fix: allow export all as identifier syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeMasen committed Nov 24, 2022
1 parent 1642f04 commit b2a94d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/decl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ pub enum ModExport<'a> {
/// ```js
/// export * from 'mod';
/// ```
All(Lit<'a>),
All {
alias: Option<Ident<'a>>,
name: Lit<'a>,
},
}

// pub struct NamedExportDecl<'a> {
Expand Down
7 changes: 6 additions & 1 deletion src/spanned/decl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ pub enum ModExportSpecifier<'a> {
/// ```
All {
star: Slice<'a>,
alias: Option<Alias<'a>>,
keyword: Slice<'a>,
name: Lit<'a>,
},
Expand Down Expand Up @@ -415,9 +416,13 @@ impl<'a> From<ModExportSpecifier<'a>> for crate::decl::ModExport<'a> {
ModExportSpecifier::Named(inner) => Self::Named(inner.into()),
ModExportSpecifier::All {
star: _,
alias,
keyword: _,
name,
} => Self::All(name.into()),
} => Self::All {
alias: alias.map(|a| a.ident.into()),
name: name.into()
},
}
}
}
Expand Down

0 comments on commit b2a94d9

Please sign in to comment.