From 515ad657ec6ef685c9c91479540518a0091f1516 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 27 Apr 2024 00:09:48 +0300 Subject: documentation --- src/lower.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lower.c') diff --git a/src/lower.c b/src/lower.c index 1949bd5..af9f9d4 100644 --- a/src/lower.c +++ b/src/lower.c @@ -605,6 +605,9 @@ static void lower_global_var(struct fn *f, struct ast *n) { static void add_proc(struct ast *n) { size_t idx = vec_len(&fns); + /* global locs are effectively just indexes, so this is a nifty way to + * encode the procedure index into the AST for later use by + * lower_proc_call and so on */ n->l = build_global_loc(idx); struct fn f = {.name = proc_id(n), .idx = idx, -- cgit v1.2.3