all repos — hex @ 87c8c9e3b3e9c86af6e0c5615a7253ddaacc97d3

A tiny, minimalist, slightly-esoteric concatenative programming lannguage.

Fixes.
h3rald h3rald@h3rald.com
Sun, 24 Nov 2024 15:49:24 +0000
commit

87c8c9e3b3e9c86af6e0c5615a7253ddaacc97d3

parent

fbd21a176eb705e6eb8d947ed24f27956f274b8c

2 files changed, 11 insertions(+), 7 deletions(-)

jump to
M hex.chex.c

@@ -271,7 +271,9 @@ ////////////////////////////////////////

void hex_debug(const char *format, ...); void hex_debug_element(const char *message, HEX_StackElement element); +void hex_print_element(FILE *stream, HEX_StackElement element); void add_to_stack_trace(HEX_Token *token); +char *hex_type(HEX_ElementType type); HEX_StackElement HEX_STACK[HEX_STACK_SIZE]; int HEX_TOP = -1;

@@ -291,6 +293,7 @@ {

HEX_StackElement value; if (hex_get_symbol(element.symbolName, &value)) { + hex_print_element(stdout, value); result = hex_push(value); } else

@@ -481,8 +484,6 @@ fprintf(stdout, "\n");

va_end(args); } } - -void hex_print_element(FILE *stream, HEX_StackElement element); char *hex_type(HEX_ElementType type) {
M tests.hextests.hex

@@ -20,23 +20,26 @@ if

) ( ; Store error - errors test-count str " - " cat error cat q cat "errors" store + errors test-count str " - " cat error cat q cat dup puts "errors" store "x" print failures 0x1 + "failures" store + errors puts ) try ) "test" store + ; --- Tests -;(0x1 "a" store a 0x1 == dup) test i +;(0x1 "a" store a 0x1 ==) test i (a free 0x1) test i ; --- Report "\nSuccessful Tests: " print successes dec print "/" print successes failures + dec puts -(errors len 0x0 >) - (errors (warn) each) -when + +;(errors len 0x0 >) +; (errors (warn) each) +;when ; --- Cleanup ;"a" free