From 204f6f332318056a9b950e71e4a958da0c10ea72 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 26 Sep 2026 23:30:40 +0200 Subject: prc1: Rework arg handling + dbg --- src/prc1/call.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/prc1/call.c') diff --git a/src/prc1/call.c b/src/prc1/call.c index 8140eba..21ef4de 100644 --- a/src/prc1/call.c +++ b/src/prc1/call.c @@ -1,4 +1,5 @@ #include "call.h" +#include "dbg.h" #include "errloc.h" #include "fn.h" #include "lex.h" @@ -148,8 +149,8 @@ static int callpr(const struct lex *l, struct prv *p) else if (pop(l, p)) return -1; - fprintf(stderr, "\t\tadding call to %s using %zu params " - "and %s as return variable\n", c->tk->s, n, tk->s); + dbg("\t\tadding call to %s using %zu params and %s as return variable\n", + c->tk->s, n, tk->s); c->ret = e; c->nparams = n; p->stk = ++tk; @@ -184,8 +185,7 @@ static int callr(const struct lex *l, struct prv *p) else if (pop(l, p)) return -1; - fprintf(stderr, "\t\tadding call to %s with %s as return variable\n", - c->tk->s, tk->s); + dbg("\t\tadding call to %s with %s as return variable\n", c->tk->s, tk->s); c->ret = e; p->stk = ++tk; return 1; @@ -229,7 +229,7 @@ static int callp(const struct lex *l, struct prv *p) if (pop(l, p)) return -1; - fprintf(stderr, "\t\tadding call to %s with 1 param\n", c->tk->s); + dbg("\t\tadding call to %s with 1 param\n", c->tk->s); p->stk = tk; return 1; } @@ -249,8 +249,7 @@ static int callv(const struct lex *l, struct prv *p) else if (pop(l, p)) return -1; - fprintf(stderr, "\t\tadding call to %s with %s as return variable\n", - c->tk->s, tk->s); + dbg("\t\tadding call to %s with %s as return variable\n", c->tk->s, tk->s); p->stk = ++tk; return 1; } -- cgit v1.2.3