better error messages

This commit is contained in:
r4
2021-12-25 12:32:52 +01:00
parent f02dae603d
commit b58810e822
5 changed files with 24 additions and 5 deletions

9
tok.c
View File

@@ -14,6 +14,15 @@ size_t type_size[TypeEnumSize] = {
[TypeArr] = sizeof(((Value*)NULL)->Arr),
};
const char *type_str[TypeEnumSize] = {
[TypeVoid] = "void",
[TypeFloat] = "float",
[TypeInt] = "int",
[TypeBool] = "bool",
[TypeChar] = "char",
[TypeArr] = "arr",
};
void print_value(const Value *v, bool raw) {
switch (v->type.kind) {
case TypeVoid: