roza/lib/value.h

26 lines
388 B
C

#ifndef RZ_VALUE_H
#define RZ_VALUE_H
#include "type.h"
typedef struct {
type_t* type;
union {
double num;
int bool;
char* str;
} value;
int line;
} value_t;
void value_init(value_t* value, type_t* type, int line);
void value_free(value_t* value);
int value_eq(value_t* value, value_t* rhs);
size_t value_str(value_t* value, char* buffer, size_t size);
#endif