Skip to content

Commit

Permalink
Call emitter from compiler main
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcnn authored and bitwalker committed Sep 7, 2023
1 parent 61b1418 commit 21813eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/midenc/src/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ pub fn compile(
// let artifacts = compile()?;
// diagnostics.abort_if_errors();

// for x in artifacts {
// let dir = options.get_output_dir();
// dir.push(x.name);
// dir.set_extension("masm");
// self::emitter::write_ast_to_file(x.ast, dir.as_path());
// }

let duration = HumanDuration::since(start);
diagnostics.success(
"Finished",
Expand Down
7 changes: 7 additions & 0 deletions tools/midenc/src/compiler/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ impl Options {
output_dir,
}))
}

fn get_output_dir(&self) -> PathBuf {

Check warning on line 124 in tools/midenc/src/compiler/options.rs

View workflow job for this annotation

GitHub Actions / compiler

associated function `get_output_dir` is never used

Check warning on line 124 in tools/midenc/src/compiler/options.rs

View workflow job for this annotation

GitHub Actions / compiler

associated function `get_output_dir` is never used
match self.output_dir {
Some(ref dir) => dir.clone(),
None => self.current_dir.clone(),
}
}
}

bitflags::bitflags! {
Expand Down

0 comments on commit 21813eb

Please sign in to comment.