all repos — hex @ fa251d0c16a7ab1549b0adff6231daf675396b52

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

Added more tests.
h3rald h3rald@h3rald.com
Sat, 30 Nov 2024 16:11:32 +0100
commit

fa251d0c16a7ab1549b0adff6231daf675396b52

parent

e218d507cbc922520358045d94daa10a5e4d679d

2 files changed, 15 insertions(+), 3 deletions(-)

jump to
M hex.chex.c

@@ -2618,7 +2618,7 @@ {

FILE *file = fopen(filename.data.strValue, "r"); if (!file) { - hex_error(ctx, "Could not open file: %s", filename.data.strValue); + hex_error(ctx, "Could not open file for reading: %s", filename.data.strValue); result = 1; } else

@@ -3973,7 +3973,7 @@ printf("*** Debug mode enabled ***\n");

} else if ((strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0)) { - hex_print_help(&ctx.docs); + hex_print_help(); return 0; } else if ((strcmp(arg, "-m") == 0 || strcmp(arg, "--manual") == 0))
M tests.hextests.hex

@@ -97,8 +97,20 @@ ("abcde" "f" 0x5 insert "abcdef" ==)

((0x1 0x2 0x3) 0x4 0x3 insert (0x1 0x2 0x3 0x4) ==) ;44 - ;("this is a test" "is" index 0x6 ==) + ("this is a test" "is" index 0x2 ==) (("a" 0x1 "b") "b" index 0x2) + ("abc" "d" index 0xffffffff ==) + (("0" "0" "0" "0") "." join "0.0.0.0"==) + ;48 + + ("0.0.0.0" "." split ("0" "0" "0" "0") ==) + ("Hello, World!" "Hello" "Goodbye" replace "Goodbye, World!" ==) + ("test" "test.txt" write "test.txt" read "test" ==) + ("!" "test.txt" append "test.txt" read "test!" ==) + ;52 + + ("rm test.txt" exec 0x1) + ) "tests" store