diff options
| author | Carson Fleming <cflems@cflems.net> | 2026-07-18 22:34:54 -0700 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2026-07-18 22:46:47 -0700 |
| commit | feb1cac139ca5aa2ba76ac6a0a318bced03d8638 (patch) | |
| tree | e107f774e08daed3dedd5d39345d2b725b2d171d /ast.h | |
| parent | 385419f95c6b9c35a7c2a6168f82f7aa4a44e22b (diff) | |
| download | ccc-feb1cac139ca5aa2ba76ac6a0a318bced03d8638.tar.gz | |
loop support
Diffstat (limited to 'ast.h')
| -rw-r--r-- | ast.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -139,6 +139,14 @@ struct if_node { struct scope* scope; }; +struct loop_node { + struct expr_node* init; /* null if absent */ + struct expr_node* cond; /* null if absent */ + struct expr_node* incr; /* null if absent */ + struct stmt_node* body; + struct scope* scope; +}; + struct stmt_node { enum { STMT_EMPTY, @@ -147,6 +155,7 @@ struct stmt_node { STMT_RETURN, STMT_GROUP, STMT_IF, + STMT_LOOP, } type; union { struct expr_node expr; @@ -154,6 +163,7 @@ struct stmt_node { struct return_node return_; struct group_node group; struct if_node if_; + struct loop_node loop; } inner; struct stmt_node* next; |
