Support for if/else

This commit is contained in:
2024-06-11 05:18:45 +05:00
parent 4927054b60
commit fa45d7b383
+10
View File
@@ -256,6 +256,16 @@ char* compile(tSyntaxElement* syntaxtree) {
string_append(&result,compile(token->next->next));
if (token->next->next->next != NULL) {
compile_enter_tag(&result);
string_append(&result, "else");
compile_exit_tag(&result);
string_append(&result,compile(token->next->next->next));
}
compile_enter_tag(&result);
string_append(&result, "endif");