roza/lib/type.h

23 lines
449 B
C

#ifndef RZ_TYPE_H
#define RZ_TYPE_H
#include "commons.h"
#define TYPE_KIND(G) \
G(TYPE_NUM), G(TYPE_BOOL), G(TYPE_STR), \
G(TYPE_FUN), G(TYPE_REF)
RZ_ENUM_H(TypeKind, TYPE_KIND);
typedef struct {
TypeKind kind;
} type_t;
void type_init(type_t* type, TypeKind kind);
void type_free(type_t* type);
int type_eq(type_t* type, type_t* rhs);
size_t type_str(type_t* type, char* buffer, size_t size);
#endif