From 08d7465f5a841366ec4c66f11475ede4e9082a8d Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 24 Jun 2024 16:49:15 +0100 Subject: refactor error checking and argument parsing --- val.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'val.h') diff --git a/val.h b/val.h index 6aa85c5..4ee76d2 100644 --- a/val.h +++ b/val.h @@ -54,6 +54,7 @@ typedef struct { typedef struct { Obj obj; Chunk ch; + uint8_t arity; } ObjFunc; // Constructs a new objstring from the given C string, @@ -64,7 +65,7 @@ ObjString *objstring_copy_cstr(State *s, char *str); // taking ownership of the provided data. ObjString *objstring_take(State *S, char *src, size_t len); -ObjFunc *objfunc_new(State *S); +ObjFunc *objfunc_new(State *S, uint8_t arity); #define IS_NIL(x) (x.ty == TY_NIL) #define IS_NUM(x) (x.ty == TY_NUM) -- cgit v1.2.3