diff options
| author | iamcheeseman <[email protected]> | 2026-04-14 19:35:49 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-04-14 19:35:49 -0400 |
| commit | 24e600e7c3ce6dab4c6c3f421e5d1ae35dc04bad (patch) | |
| tree | b3cf0267cb9cd9620b0c2279549300ec65108e72 /uscript/val.h | |
| parent | b60ad836c756f39eb5eafbfadae6847ee5ed5236 (diff) | |
microscript: add core:range()
Diffstat (limited to 'uscript/val.h')
| -rw-r--r-- | uscript/val.h | 5 |
1 files changed, 5 insertions, 0 deletions
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; }; |
