diff --git a/src/compile.c b/src/compile.c index 72c5374..a8753c4 100644 --- a/src/compile.c +++ b/src/compile.c @@ -158,8 +158,23 @@ char* compile_expression(tSyntaxElement* syntaxelement) { } else { - string_append(&result,token->content.string); - compile_genexec(&result, token); + if (strcmp(token->content.string, "if") == 0) { + + string_append(&result,compile_expression_wrapped(token->next)); + string_append(&result,"?"); + + string_append(&result,compile_expression_wrapped(token->next->next)); + string_append(&result,":"); + + string_append(&result,compile_expression_wrapped(token->next->next->next)); + + } + else { + + string_append(&result,token->content.string); + compile_genexec(&result, token); + + } } break;