Skip to content

Commit ff79b90

Browse files
committed
wip about printing
1 parent 3e63625 commit ff79b90

File tree

1 file changed

+6
-0
lines changed
  • compiler/noirc_driver/src

1 file changed

+6
-0
lines changed

compiler/noirc_driver/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,12 @@ pub fn check_crate(
300300
let nodes = to_string_pretty(&context.def_interner.nodes).unwrap();
301301
let nodes_path = context.package_build_path.join("hir.json");
302302
std::fs::write(nodes_path, nodes).unwrap();
303+
let def_map = context.def_map(&crate_id).unwrap();
304+
let root_module = &def_map.modules()[def_map.root().0];
305+
let root_module_definition_names = root_module.definitions().values().keys().collect::<Vec<_>>();
306+
println!("Root module definitions: {:#?}", root_module_definition_names);
307+
let root_module_sub_module_names = root_module.children.keys().collect::<Vec<_>>();
308+
println!("Root module sub-modules: {:#?}", root_module_sub_module_names);
303309

304310
if has_errors(&errors, options.deny_warnings) {
305311
Err(errors)

0 commit comments

Comments
 (0)