Working map gen

This commit is contained in:
2026-06-14 04:06:39 +02:00
parent db3ae3f37e
commit 33d6c931f5
2 changed files with 16 additions and 2 deletions
+15 -1
View File
@@ -238,13 +238,27 @@ fn transpile_file(path *PathBuf, source *str, mut output_file PathBuf, mod_decl
let res = fs::write(&output_file, format!("{mod_decl}{output}"));
let output_file_map = output_file.with_extension("map.json");
let res_map = fs::write(&output_file_map, serde_json::to_string(&gc.mapping).unwrap());
if res_map.is_err() {
eprintln!(
"error: failed to write mapping output {}\n {}",
output_file_map.display(),
res.as_ref().unwrap_err(),
);
}
if res.is_err() {
eprintln!(
"error: failed to write output {}\n {}",
output_file.display(),
res.unwrap_err(),
res.as_ref().unwrap_err(),
);
}
if res_map.is_err() || res.is_err() {
process::exit(1);
}
}