all repos — hex @ a61f8112579e08339fec448e1a149c1bf42e8e5f

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

Testing hex_symbol_try.
h3rald h3rald@h3rald.com
Sun, 24 Nov 2024 13:34:09 +0100
commit

a61f8112579e08339fec448e1a149c1bf42e8e5f

parent

d59f0ac31153ad70f0f6db16ca843be8919a6482

4 files changed, 13 insertions(+), 8 deletions(-)

jump to
M .gitignore.gitignore

@@ -53,3 +53,6 @@ dkms.conf

# Exe names hex + +# Other +example.hex
M MakefileMakefile

@@ -11,5 +11,5 @@ clean:

rm hex test: ./hex tests.hex -debug-test: +dtest: ./hex -d tests.hex
M hex.chex.c

@@ -794,7 +794,7 @@ // Ignore comments

} else { - hex_error("Unexpected token in quotation: >>%s<<", token->value); + hex_error("Unexpected token in quotation: %d", token->value); hex_free_token(token); free(quotation); return 1;

@@ -3209,9 +3209,11 @@

HEX_ERRORS = 0; for (int i = 0; i < tryBlock.quotationSize; i++) { + printf("-> "); + hex_print_element(stdout, *tryBlock.data.quotationValue[i]); + printf("\n"); if (hex_push(*tryBlock.data.quotationValue[i]) != 0) { - result = 1; break; } }
M tests.hextests.hex

@@ -5,7 +5,7 @@ () "errors" store

( "current-test" store - test-count 0x1 + "test-counnt" store + test-count 0x1 + "test-count" store ( (current-test i) (

@@ -20,7 +20,7 @@ if

) ( ; Store error - errors test-count str " - " concat error concat q concat "errors" store + ;errors test-count str " - " concat error concat q concat "errors" store "x" print failures 0x1 + "failures" store )

@@ -28,14 +28,14 @@ try

) "test" store ; --- Tests -(0x1 "a" store a 0x1 == dup) test i +;(0x1 "a" store a 0x1 == dup) test i (a free 0x1) test i ; --- Report "\nSuccessful Tests: " print successes dec print "/" print successes failures + dec puts -(errors length 0 >) - errors (warn) each +(errors len 0x0 >) + (errors (warn) each) when ; --- Cleanup