Fix linker, add e2e tests

This commit is contained in:
Sofia 2025-07-21 09:59:35 +03:00
parent cbea8660c2
commit 2e829bc8a9
2 changed files with 16 additions and 5 deletions

View File

@ -103,10 +103,10 @@ impl<'map> Pass for LinkerPass<'map> {
modules.insert(module.name.clone(), Rc::new(RefCell::new((module, tokens)))); modules.insert(module.name.clone(), Rc::new(RefCell::new((module, tokens))));
} }
// modules.insert( modules.insert(
// "std".to_owned(), "std".to_owned(),
// Rc::new(RefCell::new(compile_std(&mut self.module_map)?)), Rc::new(RefCell::new(compile_std(&mut self.module_map)?)),
// ); );
let mut modules_to_process: Vec<Rc<RefCell<(Module, Vec<FullToken>)>>> = let mut modules_to_process: Vec<Rc<RefCell<(Module, Vec<FullToken>)>>> =
modules.values().cloned().collect(); modules.values().cloned().collect();

View File

@ -26,9 +26,10 @@ pub static FIBONACCI: &str = include_str!("../../reid_src/fibonacci.reid");
pub static HELLO_WORLD: &str = include_str!("../../reid_src/hello_world.reid"); pub static HELLO_WORLD: &str = include_str!("../../reid_src/hello_world.reid");
pub static MUTABLE: &str = include_str!("../../reid_src/mutable.reid"); pub static MUTABLE: &str = include_str!("../../reid_src/mutable.reid");
pub static STRINGS: &str = include_str!("../../reid_src/strings.reid"); pub static STRINGS: &str = include_str!("../../reid_src/strings.reid");
pub static ARRAYS: &str = include_str!("../../reid_src/array.reid");
pub static STRUCTS: &str = include_str!("../../reid_src/struct.reid"); pub static STRUCTS: &str = include_str!("../../reid_src/struct.reid");
pub static ARRAY_STRUCTS: &str = include_str!("../../reid_src/array_structs.reid"); pub static ARRAY_STRUCTS: &str = include_str!("../../reid_src/array_structs.reid");
pub static BORROW: &str = include_str!("../../reid_src/borrow.reid");
pub static ARITHMETIC: &str = include_str!("../../reid_src/arithmetic.reid");
#[test] #[test]
fn array_compiles_well() { fn array_compiles_well() {
@ -69,3 +70,13 @@ fn struct_compiles_well() {
fn array_structs_compiles_well() { fn array_structs_compiles_well() {
test(ARRAY_STRUCTS, "array_structs"); test(ARRAY_STRUCTS, "array_structs");
} }
#[test]
fn borrow_structs_compiles_well() {
test(BORROW, "borrow");
}
#[test]
fn arithmetic_structs_compiles_well() {
test(ARITHMETIC, "arithmetic");
}