diff --git a/examples/unicode.modal b/examples/unicode.modal new file mode 100644 index 0000000..a1fe73f --- /dev/null +++ b/examples/unicode.modal @@ -0,0 +1,4 @@ +<> (🯅 |) () +<> (🯅 ?x) (?x 🯅) + +🯅 _ _ _ | diff --git a/makefile b/makefile index 906314b..afebb2f 100644 --- a/makefile +++ b/makefile @@ -10,7 +10,7 @@ dest: run: all bin/modal @ bin/modal -q examples/hello.modal debug: all bin/modal-debug - @ bin/modal-debug -a examples/hello.modal + @ bin/modal-debug -a examples/unicode.modal test: all bin/modal-debug bin/modal @ bin/modal -v @ bin/modal-debug -q examples/fizzbuzz.modal diff --git a/src/modal.c b/src/modal.c index 55ef37f..dcdbd88 100644 --- a/src/modal.c +++ b/src/modal.c @@ -105,7 +105,7 @@ file_import(char *path, char *ptr) FILE *f; int pr = 0; if((f = fopen(path, "r"))) { - char c; + unsigned char c; while(fread(&c, 1, 1, f)) { c = c <= 0x20 ? 0x20 : c; if(c == '(') pr++;