updated compiler to support multiple frontends and backends
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
use crate::model::{CompilerError, Program};
|
||||
|
||||
mod dsa;
|
||||
|
||||
pub fn compiler_backend(ext: &str, ast: &Program) -> Result<String, CompilerError> {
|
||||
match ext {
|
||||
"dsa" => Ok(dsa::generate_code(ast)?),
|
||||
_ => Err(CompilerError::Generic(format!(
|
||||
"File type {} not supported",
|
||||
ext
|
||||
))),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user