From fa45d7b3839acd397376fa613d8e20274e29208f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?b=CA=B0edoh=E2=82=82=20sw=C3=A9?= Date: Tue, 11 Jun 2024 05:18:45 +0500 Subject: [PATCH] Support for if/else --- src/compile.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/compile.c b/src/compile.c index fa827a9..fe55cf5 100644 --- a/src/compile.c +++ b/src/compile.c @@ -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");