From e6027bbaf2d08699444b874a2406bfd33c613817 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 16:53:40 +0500 Subject: [PATCH] Allow print to take multiple arguments --- src/compile.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/compile.c b/src/compile.c index 6abb7f9..19f7f15 100644 --- a/src/compile.c +++ b/src/compile.c @@ -317,9 +317,13 @@ char* compile(tSyntaxElement* syntaxtree) { } else if (strcmp(token->content.string, "print") == 0) { - string_append(&result, "{{"); - string_append(&result,compile_expression(token->next)); - string_append(&result, "}}"); + for(tSyntaxElement* i = token->next; i != NULL; i = i->next) { + + string_append(&result, "{{"); + string_append(&result,compile_expression(i)); + string_append(&result, "}}"); + + } } else {