Bit flags for enums too

This commit is contained in:
Bruce Hill 2024-02-14 23:45:37 -05:00
parent f2307aee53
commit 0577469f9c

View File

@ -349,7 +349,9 @@ CORD compile(env_t *env, ast_t *ast)
for (tag_ast_t *tag = def->tags; tag; tag = tag->next) {
env->types = CORD_cat(env->types, "struct {\n");
for (arg_ast_t *field = tag->fields; field; field = field->next) {
CORD_appendf(&env->types, "%r %s;\n", compile_type(env, field->type), field->name);
CORD type = compile_type(env, field->type);
CORD_appendf(&env->types, "%r %s%s;\n", type, field->name,
CORD_cmp(type, "Bool_t") ? "" : ":1");
}
CORD_appendf(&env->types, "} %s;\n", tag->name);
}