6699333b2c
- If statements work properly now (hopefully) - still issues with while loops pushing vars to the stack. need scoping implemented to fix this! - refactored registers.rs and fixed faulty logic. - made register allocation optimisations
16 lines
388 B
Rust
16 lines
388 B
Rust
use crate::model::{CompilerError, Program};
|
|
|
|
// mod c;
|
|
mod dsc;
|
|
|
|
pub fn compiler_frontend(ext: &str, data: &str) -> Result<Program, CompilerError> {
|
|
match ext {
|
|
"dsc" => Ok(dsc::generate_ast(&data)?),
|
|
// "c" => Ok(c::generate_ast(&data)?),
|
|
_ => Err(CompilerError::Generic(format!(
|
|
"File type {} not supported",
|
|
ext
|
|
))),
|
|
}
|
|
}
|