Safety commit

This commit is contained in:
Mid
2024-11-20 16:36:17 +02:00
parent 07f6d57aba
commit ba6f9fb6c1
16 changed files with 708 additions and 317 deletions

View File

@@ -132,6 +132,10 @@ Type *type_pointer_wrap(Type *t) {
return (Type*) ret;
}
int type_is_number(Type *t) {
return t->type == TYPE_TYPE_POINTER || t->type == TYPE_TYPE_PRIMITIVE;
}
int type_is_castable(Type *from, Type *to) {
if(type_equal(from, to)) return 2;
@@ -152,4 +156,4 @@ int type_is_castable(Type *from, Type *to) {
}
return 0;
}
}