mirror of
https://github.com/HigherOrderCO/Bend.git
synced 2024-08-17 07:40:48 +03:00
Fix gen-cu and gen-c commands after move to hvm ast
This commit is contained in:
parent
be9eaeb7cf
commit
2a1eefb8c2
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -62,7 +62,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bend-lang"
|
||||
version = "0.2.22"
|
||||
version = "0.2.23"
|
||||
dependencies = [
|
||||
"TSPL",
|
||||
"clap",
|
||||
|
@ -2,7 +2,7 @@
|
||||
name = "bend-lang"
|
||||
description = "A high-level, massively parallel programming language"
|
||||
license = "Apache-2.0"
|
||||
version = "0.2.22"
|
||||
version = "0.2.23"
|
||||
edition = "2021"
|
||||
rust-version = "1.74"
|
||||
exclude = ["tests/snapshots/"]
|
||||
|
@ -299,7 +299,8 @@ fn execute_cli_mode(mut cli: Cli) -> Result<(), Diagnostics> {
|
||||
let compile_res = compile_book(&mut book, opts, diagnostics_cfg, None)?;
|
||||
|
||||
let out_path = ".out.hvm";
|
||||
std::fs::write(out_path, compile_res.hvm_book.show()).map_err(|x| x.to_string())?;
|
||||
std::fs::write(out_path, display_hvm_book(&compile_res.hvm_book).to_string())
|
||||
.map_err(|x| x.to_string())?;
|
||||
|
||||
let gen_fn = |out_path: &str| {
|
||||
let mut process = std::process::Command::new("hvm");
|
||||
@ -312,6 +313,10 @@ fn execute_cli_mode(mut cli: Cli) -> Result<(), Diagnostics> {
|
||||
let err = String::from_utf8_lossy(&stderr);
|
||||
let status = if !status.success() { status.to_string() } else { String::new() };
|
||||
|
||||
if let Err(e) = std::fs::remove_file(out_path) {
|
||||
eprintln!("Error removing HVM output file. {e}");
|
||||
}
|
||||
|
||||
eprintln!("{err}");
|
||||
println!("{out}");
|
||||
println!("{status}");
|
||||
|
Loading…
Reference in New Issue
Block a user