26 lines
504 B
C
26 lines
504 B
C
#include <blue/ds/string.h>
|
|
#include <mie/dialect/dialect.h>
|
|
#include <mie/dialect/type.h>
|
|
|
|
struct mie_dialect_type *mie_dialect_type_create(
|
|
struct mie_dialect *parent, const char *name)
|
|
{
|
|
struct mie_dialect_type *out = malloc(sizeof *out);
|
|
if (!out) {
|
|
return NULL;
|
|
}
|
|
|
|
out->ty_name = b_strdup(name);
|
|
if (!out->ty_name) {
|
|
free(out);
|
|
return NULL;
|
|
}
|
|
|
|
out->ty_parent = parent;
|
|
|
|
b_rope name_rope = B_ROPE_CSTR(name);
|
|
mie_id_map_put(&parent->d_types, &out->ty_id, &name_rope);
|
|
|
|
return out;
|
|
}
|