Updated mapping data structure

This commit is contained in:
2026-06-15 14:49:44 +02:00
parent 44f10d3fb7
commit 663dab52ec
5 changed files with 81 additions and 63 deletions
+10 -7
View File
@@ -135,19 +135,22 @@ pub fn transpile_file(path: &Path, output_path: &Path) -> Result<(), String> {
// If parsing fails, return the error string back gracefully so the LSP can show it
let ast = parser_result.map_err(|e| format!("parse failed in {}:\n{}", path.display(), e))?;
let mut gc = mist_codegen::RustCodegen::new();
let output = gc.generate(ast);
panic!();
fs::write(output_path, output)
.map_err(|e| format!("failed to write output {}: {}", output_path.display(), e))?;
// let mut gc = mist_codegen::RustCodegen::new();
// let output = gc.generate(ast);
Ok(())
// fs::write(output_path, output)
// .map_err(|e| format!("failed to write output {}: {}", output_path.display(), e))?;
// Ok(())
}
pub fn transpile_text<'a>(source: &'a str) -> Result<String, ParseError<'a, Vec<TopLevel>>> {
let mut gc = mist_codegen::RustCodegen::new();
panic!();
// let mut gc = mist_codegen::RustCodegen::new();
Ok(gc.generate(mist_parser::parse(&source)?))
// Ok(gc.generate(mist_parser::parse(&source)?))
}
fn should_skip(source: &Path, output: &Path) -> bool {