aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-30 04:11:27 +0200
committerhachem <im@hachem.wtf>2026-08-30 04:11:27 +0200
commitaffa20ab497911353babc9ed6c580c8a12b2bf15 (patch)
tree6d7c8d2164cbf1403819991baf62d8201049b778 /src/main.c
parent2e7cab34d22a0174909030942671e95d5a3c769f (diff)
add: parse proc declarations
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index b351bd8..e65362c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -46,6 +46,20 @@ int main(int argc, char** argv)
(int)decl.value.length, decl.value.start);
}
+ for (size_t i = 0; i < program.proc_count; i += 1)
+ {
+ struct ProcDecl proc = program.procs[i];
+ printf("proc %.*s(", (int)proc.name.length, proc.name.start);
+ for (size_t p = 0; p < proc.param_count; p += 1)
+ {
+ struct Param param = proc.params[p];
+ printf("%s%.*s: %.*s", p == 0 ? "" : ", ",
+ (int)param.name.length, param.name.start,
+ (int)param.reg.length, param.reg.start);
+ }
+ printf(")\n");
+ }
+
free_program(&program);
free_file(&source);
}