From a1d14e8cfa274abb5a76a193c353615154211a97 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 15:59:53 +0500 Subject: [PATCH] Add "neg" and "not" keywords --- src/compile.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/compile.c b/src/compile.c index e907862..6ac0006 100644 --- a/src/compile.c +++ b/src/compile.c @@ -175,6 +175,16 @@ char* compile_expression(tSyntaxElement* syntaxelement) { 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);