Skip to content

Commit

Permalink
Merge pull request #7 from rusty-ecma/export-all-as
Browse files Browse the repository at this point in the history
fix: allow export all as identifier syntax
  • Loading branch information
FreeMasen authored May 6, 2023
2 parents 1642f04 + b2a94d9 commit 63c6214
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 63c6214

Please sign in to comment.