mie: implemented array value type; restructure const value structures

there are now separate structs for all const types (int, string, etc),
rather than a single mie_const union.
This commit is contained in:
2025-04-23 15:42:58 +01:00
parent 4ea9683880
commit ef4b4d2f66
8 changed files with 156 additions and 47 deletions

View File

@@ -2,20 +2,12 @@
#include <stdlib.h>
#include <string.h>
struct mie_const *mie_const_create(struct mie_type *type)
void mie_const_init(struct mie_const *c, struct mie_type *type)
{
struct mie_const *c = malloc(sizeof *c);
if (!c) {
return NULL;
}
memset(c, 0x0, sizeof *c);
mie_value_init(&c->c_base, MIE_VALUE_CONST);
c->c_type = type;
return c;
}
static struct mie_type *get_type(struct mie_value *v)