summaryrefslogtreecommitdiff
path: root/com.c
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-08-06 18:24:28 +0100
committerubq323 <ubq323@ubq323.website>2024-08-06 18:24:28 +0100
commita701883f4ea83022261304d225eb8225af52b302 (patch)
treed95127abc4cfa953653bdc550ebada0061678d16 /com.c
parent0cc8e1fd89aacd54926b61ac3b9c4a2810024b4a (diff)
fix failing tests
Diffstat (limited to 'com.c')
-rw-r--r--com.c11
1 files changed, 8 insertions, 3 deletions
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);