aboutsummaryrefslogtreecommitdiff
path: root/src/prc1/call.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-09-26 23:30:40 +0200
committerXavier Del Campo Romero <xavi92@disroot.org>2026-09-27 23:57:29 +0200
commit204f6f332318056a9b950e71e4a958da0c10ea72 (patch)
tree5d7938d9ed44dbe9455d2a88b2ef93a4beef4397 /src/prc1/call.c
parent88d1bca43a8412b285ea2dd54dfa98d08ecc7849 (diff)
downloadprc-204f6f332318056a9b950e71e4a958da0c10ea72.tar.gz
prc1: Rework arg handling + dbg
Diffstat (limited to 'src/prc1/call.c')
-rw-r--r--src/prc1/call.c13
1 files changed, 6 insertions, 7 deletions
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;
}