From 50c5667f1414f805d16aff3bcd62c6be3ffac241 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Wed, 22 Jan 2020 17:08:48 -0500 Subject: fixed tests --- .gitignore | 1 + main.c | 2 +- tests/bf/bf.toc | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index ba8d9a8..3326907 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ tags *.o compatibility std/*.c +std/*.o diff --git a/main.c b/main.c index 3d7f527..c979e5f 100644 --- a/main.c +++ b/main.c @@ -18,7 +18,7 @@ /* TODO: -run time foreign functions +get tests to compile without warnings foreign non-functions no foreign parameter declarations variadic fns diff --git a/tests/bf/bf.toc b/tests/bf/bf.toc index 29f0bcc..b624101 100644 --- a/tests/bf/bf.toc +++ b/tests/bf/bf.toc @@ -1,4 +1,5 @@ getstdin ::= fn() []char { +#C("extern void *stdin; extern char *fgets(char *buf, size_t sz, void *f);"); contents : []char; contents_sz : int; contents_len : int; @@ -96,7 +97,7 @@ main ::= fn() { } } elif code[i] == '.' { c := tape[ptr] as char; - #C("putc(c, stdout)"); + #C("putchar(c)"); } elif code[i] == ',' { // Input doesn't really work, because you // need to send an EOF to end the program. @@ -105,4 +106,4 @@ main ::= fn() { } del(tape); del(code); -}; \ No newline at end of file +}; -- cgit v1.2.3