implemented enum parsing
This commit is contained in:
parent
c34bea6fff
commit
5902ec8dbc
4 changed files with 113 additions and 2 deletions
8
lc.c
8
lc.c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue