Add "string" command

This commit is contained in:
bʰedoh₂ swé 2024-06-17 04:43:31 +05:00
parent 56a0390be3
commit 2833dc28b9
2 changed files with 13 additions and 0 deletions

View File

@ -186,6 +186,16 @@ void execute(Stack *stack, Stack *originstack, char *modname)
continue;
}
if (!strcmp(NAME, "string"))
{
for (char *i = ARG; *i != '\0'; i++)
stack_push(stack, *i);
stack_push(stack, strlen(ARG));
continue;
}
// Math
if (!strcmp(NAME, "add"))

3
tests/string_push.lb Normal file
View File

@ -0,0 +1,3 @@
@ 0
$string Hello world!
dump