Add if as an expression
This commit is contained in:
parent
d8636ace10
commit
e8ca2af9bc
@ -158,10 +158,25 @@ char* compile_expression(tSyntaxElement* syntaxelement) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
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);
|
string_append(&result,token->content.string);
|
||||||
compile_genexec(&result, token);
|
compile_genexec(&result, token);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user