implemented if statement parsing
This commit is contained in:
parent
d6d2230f14
commit
c34bea6fff
3 changed files with 19 additions and 4 deletions
4
lc.c
4
lc.c
|
|
@ -151,7 +151,9 @@ void print_ast(ast_node *node, int depth) {
|
|||
}
|
||||
break;
|
||||
case NODE_IF:
|
||||
printf("IfStmt (Fields missing in struct)\n");
|
||||
printf("If:\n");
|
||||
print_ast(node->expr.whle.condition, depth + 1);
|
||||
print_ast(node->expr.whle.body, depth + 1);
|
||||
break;
|
||||
case NODE_VAR_DECL:
|
||||
printf("VarDecl: %.*s: %.*s\n", (int)node->expr.var_decl.name_len, node->expr.var_decl.name, (int)node->expr.var_decl.type_len, node->expr.var_decl.type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue