From a701883f4ea83022261304d225eb8225af52b302 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Tue, 6 Aug 2024 18:24:28 +0100 Subject: fix failing tests --- com.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'com.c') diff --git a/com.c b/com.c index 3b2260d..57e600c 100644 --- a/com.c +++ b/com.c @@ -619,10 +619,10 @@ static void cpl_expr(Compiler *C, Val v, int flags) { if (form) { size_t nargs = len - 1; if (form->ellipsis) - CHECK(nargs >= form->min_params, "%s requires at least %d args", + CHECK(nargs >= form->min_params, "%s requires at least %d parameters", form->name, form->min_params); else - CHECK(nargs == form->min_params, "%s requires exactly %d args", + CHECK(nargs == form->min_params, "%s requires exactly %d parameters", form->name, form->min_params); form->action(C, a, form->op, flags); } else { @@ -654,6 +654,7 @@ int main(int argc, char **argv) { S->do_disasm = false; S->do_trace = false; + S->do_dumpsexpr = false; char *infile_names[16]; int infile_name_n = 0; @@ -669,6 +670,7 @@ int main(int argc, char **argv) { switch (argv[i][2]) { case 'l': S->do_disasm = true; break; case 't': S->do_trace = true; break; + case 's': S->do_dumpsexpr = true; break; default: ERROR("unknown option b"); } break; @@ -699,9 +701,12 @@ int main(int argc, char **argv) { fread(buf, 1, 8192, infile); buf[8192] = '\0'; ObjArr *top = read_exprs(S, buf); + + if (S->do_dumpsexpr) + println_val(VAL_OBJ(top)); + cpl_body(&com, top, 0, 0); - // println_val(VAL_OBJ(top)); // pcc_destroy(parser); // compile_body(&com, top.as.list, 0, 0); -- cgit v1.2.3