unify printing + add basic strings

This commit is contained in:
r4
2021-12-25 12:16:06 +01:00
parent 92c4c5c991
commit f02dae603d
8 changed files with 162 additions and 52 deletions

13
tok.h
View File

@@ -13,23 +13,36 @@ typedef struct Type {
TypeInt,
TypeBool,
TypeChar,
TypeArr,
TypeEnumSize,
} kind;
/*union {
};*/
} Type;
extern size_t type_size[TypeEnumSize];
typedef struct Value {
Type type;
union {
pseudo_void Void;
double Float;
ssize_t Int;
bool Bool;
char Char;
struct {
bool is_string : 1;
Type type;
void *vals;
size_t len, cap;
} Arr;
};
} Value;
void print_value(const Value *v, bool raw);
enum Operator {
OpLCurl = '{',
OpRCurl = '}',