implemented enum parsing

This commit is contained in:
Lorenzo Torres 2025-12-03 13:08:42 +01:00
parent c34bea6fff
commit 5902ec8dbc
4 changed files with 113 additions and 2 deletions

8
lc.c
View file

@ -150,6 +150,14 @@ void print_ast(ast_node *node, int depth) {
m = m->next;
}
break;
case NODE_ENUM:
printf("Enum: %.*s\n", (int)node->expr.enm.name_len, node->expr.enm.name);
variant *v = node->expr.enm.variants;
while (v) {
printf("\t%.*s\n", (int)v->name_len, v->name);
v = v->next;
}
break;
case NODE_IF:
printf("If:\n");
print_ast(node->expr.whle.condition, depth + 1);