Encapsulate imported modules into AST.

This commit is contained in:
Stephen Chung
2020-11-09 21:52:23 +08:00
parent 821e64adc4
commit e69444293c
8 changed files with 47 additions and 17 deletions

View File

@@ -2485,13 +2485,11 @@ fn parse_fn(
access,
params,
#[cfg(not(feature = "no_closure"))]
externals: if externals.is_empty() {
None
} else {
Some(Box::new(externals))
},
externals,
body,
lib: None,
#[cfg(not(feature = "no_module"))]
mods: Default::default(),
})
}
@@ -2661,6 +2659,8 @@ fn parse_anon_fn(
externals: Default::default(),
body,
lib: None,
#[cfg(not(feature = "no_module"))]
mods: Default::default(),
};
let expr = Expr::FnPointer(Box::new(IdentX::new(fn_name, settings.pos)));