diff options
| author | hachem <im@hachem.wtf> | 2026-08-30 04:11:27 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-30 04:11:27 +0200 |
| commit | affa20ab497911353babc9ed6c580c8a12b2bf15 (patch) | |
| tree | 6d7c8d2164cbf1403819991baf62d8201049b778 /src/main.c | |
| parent | 2e7cab34d22a0174909030942671e95d5a3c769f (diff) | |
add: parse proc declarations
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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); } |
