functions

This commit is contained in:
2024-07-01 18:24:02 +02:00
parent 001636c799
commit 41c6b99e26
3 changed files with 21 additions and 2 deletions
+7
View File
@@ -41,6 +41,13 @@ impl Transpiler {
Ast::Variable(var_type, var_name) => {
res += format!("let mut {}: {}", var_name, var_type).as_str();
}
Ast::Function(var_type, var_name, round, curly) => {
res += format!(
"fn {}({}) -> {} {}{}{}",
var_name, round, var_type, "{", curly, "}"
)
.as_str();
}
}
}
res