From b2a94d92c44734495bf46f061b9b5f4e6d966056 Mon Sep 17 00:00:00 2001 From: Robert Masen Date: Thu, 24 Nov 2022 14:43:39 -0600 Subject: [PATCH] fix: allow export all as identifier syntax --- src/decl.rs | 5 ++++- src/spanned/decl.rs | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/decl.rs b/src/decl.rs index d9f4dd0..dd39377 100644 --- a/src/decl.rs +++ b/src/decl.rs @@ -142,7 +142,10 @@ pub enum ModExport<'a> { /// ```js /// export * from 'mod'; /// ``` - All(Lit<'a>), + All { + alias: Option>, + name: Lit<'a>, + }, } // pub struct NamedExportDecl<'a> { diff --git a/src/spanned/decl.rs b/src/spanned/decl.rs index 0be1091..0dbaba1 100644 --- a/src/spanned/decl.rs +++ b/src/spanned/decl.rs @@ -387,6 +387,7 @@ pub enum ModExportSpecifier<'a> { /// ``` All { star: Slice<'a>, + alias: Option>, keyword: Slice<'a>, name: Lit<'a>, }, @@ -415,9 +416,13 @@ impl<'a> From> 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() + }, } } }