implement basic RAII-ish array management

This commit is contained in:
r4
2021-12-29 21:42:43 +01:00
parent 7773cc6c14
commit 4d5cd93354
8 changed files with 137 additions and 47 deletions

2
tok.h
View File

@@ -36,12 +36,14 @@ typedef struct Value {
struct {
Type type;
bool is_string : 1;
bool dynamically_allocated : 1;
void *vals;
size_t len, cap;
} Arr;
};
} Value;
void free_value(Value *v, bool purge);
void print_value(const Value *v, bool raw);
enum Operator {