1pub mod function_map;
9pub mod lexer;
10pub mod transpiler;
11
12pub use function_map::MATLAB_FUNCTION_MAP;
13pub use transpiler::transpile_matlab_to_xdl;
14
15pub fn load_matlab_file(path: &std::path::Path) -> Result<String, String> {
17 let matlab_code =
18 std::fs::read_to_string(path).map_err(|e| format!("Failed to read file: {}", e))?;
19
20 transpile_matlab_to_xdl(&matlab_code)
21}
22
23#[cfg(test)]
24mod tests {
25 use super::*;
26
27 #[test]
28 fn test_simple_transpilation() {
29 let matlab = "x = zeros(10, 1);";
30 let result = transpile_matlab_to_xdl(matlab);
31 assert!(result.is_ok());
32 }
33}