From 24e600e7c3ce6dab4c6c3f421e5d1ae35dc04bad Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Tue, 14 Apr 2026 19:35:49 -0400 Subject: microscript: add core:range() --- uscript/val.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'uscript/val.h') diff --git a/uscript/val.h b/uscript/val.h index 5140fc2..8ea91dd 100644 --- a/uscript/val.h +++ b/uscript/val.h @@ -28,6 +28,10 @@ #define proto_add_byte(func, op) da_append(u8, &(func)->bytecode, op) +#define cfunc_add_upval(c, v) da_append(struct us_val, &c->upvals, v) +#define cfunc_set_upval(c, i, v) (c->upvals[i] = (v)) +#define cfunc_get_upval(c, i) (c->upvals[i]) + enum val_type { VAL_NUM, VAL_BOOL, @@ -90,6 +94,7 @@ struct us_cfunc { struct us_obj header; us_cfunc_sig c; const struct us_str *name; + struct us_val *upvals; int argc; }; -- cgit v1.3-2-g0d8e