Compare commits

...

2 Commits

Author SHA1 Message Date
a1d14e8cfa Add "neg" and "not" keywords 2024-06-11 15:59:53 +05:00
8bf0af96ee Add get keyword 2024-06-11 05:48:18 +05:00

View File

@ -168,12 +168,28 @@ char* compile_expression(tSyntaxElement* syntaxelement) {
string_append(&result,compile_expression_wrapped(token->next->next->next)); string_append(&result,compile_expression_wrapped(token->next->next->next));
} } else if (strcmp(token->content.string, "get") == 0) {
else {
string_append(&result,compile_expression(token->next));
string_append(&result,"[");
string_append(&result,compile_expression(token->next->next));
string_append(&result,"]");
} else if (strcmp(token->content.string, "neg") == 0) {
string_append(&result,"-");
string_append(&result,compile_expression_wrapped(token->next));
} else if (strcmp(token->content.string, "not") == 0) {
string_append(&result,"not");
string_append(&result,compile_expression_wrapped(token->next));
} else {
string_append(&result,token->content.string); string_append(&result,token->content.string);
compile_genexec(&result, token); compile_genexec(&result, token);
} }
} }