jetcrab\bytecode\statements/
modules.rs1use crate::ast::Node;
2use super::ControlFlowCore;
3
4pub fn generate_import_declaration<T>(this: &mut T, node: &Node)
5where
6 T: ControlFlowCore,
7{
8 if let Node::ImportDeclaration(decl) = node {
9 for specifier in &decl.specifiers {
12 this.visit_node(specifier);
13 }
14 this.visit_node(&decl.source);
15 }
16}
17
18pub fn generate_export_declaration<T>(this: &mut T, node: &Node)
19where
20 T: ControlFlowCore,
21{
22 if let Node::ExportDeclaration(decl) = node {
23 if let Some(declaration) = &decl.declaration {
26 this.visit_node(declaration);
27 }
28 for specifier in &decl.specifiers {
29 this.visit_node(specifier);
30 }
31 if let Some(source) = &decl.source {
32 this.visit_node(source);
33 }
34 }
35}