From dfd402721d08ac58632bed108011eda0e5aa1cad Mon Sep 17 00:00:00 2001 From: xolatile Date: Wed, 3 Apr 2024 11:05:36 -0400 Subject: [PATCH] Return... --- xiranda.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/xiranda.c b/xiranda.c index edd76de..fed1832 100644 --- a/xiranda.c +++ b/xiranda.c @@ -101,8 +101,31 @@ int main (void) { --offset; } else if (character_compare_array (buffer [offset], ",.;:=<>#&|!+*-/%()[]") == true) { char s [2] = ""; + int kind = 0; s [0] = buffer [offset]; - add_coin (coin_range, 0, s); + switch (buffer [offset]) { + case '+': kind = coin_add; break; + case '-': kind = coin_subtract; break; + case '*': kind = coin_multiply; break; + case '/': kind = coin_divide; break; + case '%': kind = coin_modulus; break; + case '=': kind = coin_equal; break; + case '>': kind = coin_above; break; + case '<': kind = coin_below; break; + case '(': kind = coin_open; break; + case ')': kind = coin_close; break; + case ',': kind = coin_next; break; + case ';': kind = coin_stop; break; + case ':': kind = coin_branch; break; + case '&': kind = coin_and; break; + case '|': kind = coin_or; break; + case '!': kind = coin_not; break; + case '.': kind = coin_range; break; + case '[': kind = coin_enrange; break; + case ']': kind = coin_derange; break; + case '#': kind = coin_machine; break; + } + add_coin (kind, (int) buffer [offset], s); } else { if (character_is_blank (buffer [offset]) == false) { echo ("\033[1;31mCharacter set exception point: Segmentation\033[0m\n"); @@ -132,11 +155,13 @@ int main (void) { } printf ("\n"); -/* + for (length = 0; length < coin_code; ++length) { - + if ((coin_enum [length] == coin_return) && (coin_enum [length + 1] == coin_stop)) { + printf ("; return;\nxor rax, rax\nret\n\n"); + } } - +/* for (length = 0; length < coin_code; ++length) { if ((coin_enum [length] == coin_word) && (coin_data [length] == word_return)) { ++length;