Forgotten cargo fmt + R-A warning cleanup

pull/3/head
itycodes 2 weeks ago
parent e33e43e221
commit b67795cdfb

@ -333,10 +333,10 @@ fn match_number(s: &str) -> Number {
pub fn compile_ast_ssa(
ast: Ast,
vars: &mut Vec<(String, String)>,
mut constants: &mut Vec<(String, String)>,
mut counter: &mut Box<i32>,
mut stack: &mut Vec<String>,
mut out: &mut Vec<(Option<String>, String)>,
constants: &mut Vec<(String, String)>,
counter: &mut Box<i32>,
stack: &mut Vec<String>,
out: &mut Vec<(Option<String>, String)>,
) {
match ast.clone().list() {
Some(l) => {
@ -356,10 +356,16 @@ pub fn compile_ast_ssa(
compile_ast_ssa(val, vars, constants, counter, stack, out);
let val_id = stack.pop().unwrap();
let ptr_id = stack.pop().unwrap();
out.push((None, format!("OpStore {} {}", fix_name(&val_id), fix_name(&ptr_id))));
out.push((
None,
format!("OpStore {} {}", fix_name(&val_id), fix_name(&ptr_id)),
));
}
s => {
panic!("Unknown function: {} with params {:#?} in context:\n{:#?}", s, lst, ast);
panic!(
"Unknown function: {} with params {:#?} in context:\n{:#?}",
s, lst, ast
);
}
}
}

@ -68,12 +68,7 @@ fn test_block_ssa() {
let mut module = meta_compile(ast.unwrap()).unwrap();
let fun = module.functions.pop().unwrap();
let block = fun.ast.unwrap();
let block = block
.list()
.unwrap()
.get(0)
.unwrap()
.clone();
let block = block.list().unwrap().get(0).unwrap().clone();
println!("{:#?}", block);
let mut vars = vec![];
let mut constants = vec![];

@ -7,7 +7,7 @@ use crate::parser::{Ast, Localised, Location};
pub mod backend;
mod meta_compile;
use std::{fmt, ops::Add, ptr};
use std::fmt;
#[cfg(test)]
mod tests;
@ -240,4 +240,3 @@ pub fn meta_compile(ast: Ast) -> Result<Module, CompilerError> {
}
Ok(module)
}

@ -291,4 +291,3 @@ fn expected_type() {
panic!()
};
}

Loading…
Cancel
Save