This commit is contained in:
2024-05-10 15:06:17 +02:00
parent a7f085fb07
commit 7aae829763
4 changed files with 10 additions and 2 deletions
+4 -1
View File
@@ -125,6 +125,8 @@ pub fn transpile_round(input: String, state: LexerState) -> String {
result += format!("{}: {}", ast.tokens[1].value, ast.tokens[0].value).as_str();
} else if ast.ast_type == AstType::MutVariableDeceleration {
result += format!("mut {}: {}", ast.tokens[1].value, ast.tokens[0].value).as_str();
} else if ast.ast_type == AstType::PointerDeceleration {
result += format!("{}: &mut {}", ast.tokens[1].value, ast.tokens[0].value).as_str();
} else if ast.tokens.len() == 1 && ast.tokens[0].token_type == TokenType::Round {
result += format!(
"({})",
@@ -135,7 +137,8 @@ pub fn transpile_round(input: String, state: LexerState) -> String {
)
.as_str();
} else {
result += ast.tokens[0].value.as_str()
result += ast.tokens[0].value.as_str();
result += " ";
}
}