Implemented updated mapping data structure

This commit is contained in:
2026-06-15 15:04:10 +02:00
parent 663dab52ec
commit 12cf4e94d8
2 changed files with 10 additions and 21 deletions
+2 -3
View File
@@ -8,7 +8,6 @@ use std::time;
use std::env;
use mist_parser::error;
use mist_parser::rev_mapper;
use crate::modules;
use mist_codegen::GetRust;
@@ -201,7 +200,7 @@ fn transpile_file(path *PathBuf, source *str, mut output_file PathBuf, mod_decl
}
}
let mut gc = mist_codegen::RustCodegen::new();
let mut gc = mist_codegen::RustCodegen::new(path.clone());
let parsed = match mist_parser::parse(source) {
Ok[ast] => ast;
@@ -239,7 +238,7 @@ fn transpile_file(path *PathBuf, source *str, mut output_file PathBuf, mod_decl
let res = fs::write(&output_file, format!("{mod_decl}{output}"));
rev_mapper::shift_rust_mappings(&mut gc.mapping, mod_decl.lines().count() as isize, 0);
gc.mapping.shift_rust(mod_decl.lines().count() as isize, 0);
let output_file_map = output_file.with_extension("map.json");