diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-14 23:45:37 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-14 23:45:37 -0500 |
| commit | 0577469f9c49473fe95eedfa27b0f282ac9ffdb6 (patch) | |
| tree | 1887f04e24d403d46036f16e0aaf07e1789cb736 /compile.c | |
| parent | f2307aee53ef6e1021bd9f03095f4b9966ebcb1f (diff) | |
Bit flags for enums too
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); } |
