diff options
| author | Carson Fleming <cflems@cflems.net> | 2026-07-17 03:20:34 -0700 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2026-07-17 03:20:34 -0700 |
| commit | 155d1971b7cd56d3206808c36c6b40357bc31cbb (patch) | |
| tree | b06b4c59d7eaa8084985b82e73b975d194eb8929 /ast.h | |
| parent | 99af8891f6672493939bf3b43084082884e28d04 (diff) | |
| download | ccc-155d1971b7cd56d3206808c36c6b40357bc31cbb.tar.gz | |
almost fibonacci but it needs the type checker
Diffstat (limited to 'ast.h')
| -rw-r--r-- | ast.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -136,6 +136,12 @@ struct return_node { struct expr_node* ret_val; /* null to return void */ }; +struct if_node { + struct expr_node* cond; + struct stmt_node* true_branch; + struct stmt_node* false_branch; +}; + struct stmt_node { enum { STMT_EMPTY, @@ -143,12 +149,14 @@ struct stmt_node { STMT_VAR_DECL, STMT_RETURN, STMT_GROUP, + STMT_IF, } type; union { struct expr_node expr; struct var_decl_node var_decl; struct return_node return_; struct group_node group; + struct if_node if_; } inner; struct stmt_node* next; |
