From 8bf0af96ee2a797e8132e1a8a5952a2fa37f30fd 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:48:18 +0500 Subject: [PATCH] Add get keyword --- src/compile.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/compile.c b/src/compile.c index a8753c4..e907862 100644 --- a/src/compile.c +++ b/src/compile.c @@ -168,12 +168,18 @@ char* compile_expression(tSyntaxElement* syntaxelement) { string_append(&result,compile_expression_wrapped(token->next->next->next)); - } - else { + } else if (strcmp(token->content.string, "get") == 0) { + + string_append(&result,compile_expression(token->next)); + string_append(&result,"["); + string_append(&result,compile_expression(token->next->next)); + string_append(&result,"]"); + + } else { string_append(&result,token->content.string); compile_genexec(&result, token); - + } }