From 6e30b8a913caf1817d7e9bd0bb9783d9f7aa1ed1 Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 17 Aug 2022 09:33:14 +0200 Subject: if and loopses --- src/cffc.hff | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/cffc.hff') diff --git a/src/cffc.hff b/src/cffc.hff index bc49f29..6147377 100644 --- a/src/cffc.hff +++ b/src/cffc.hff @@ -82,10 +82,12 @@ struct Type { } } +struct Fn; struct Parser { fp *FILE, alloc *Allocator, curfile *const u8, + curfn *Fn, curenv *Env, tokloc Loc, curloc Loc, @@ -128,10 +130,21 @@ struct Expr { } } + +struct Stmt; struct Stmt { loc Loc, u enum union { Block [#]Stmt, + If struct { test Expr, t [#]Stmt, f [#]Stmt }, + While struct { test Expr, body [#]Stmt }, + For struct { + ini [#]Stmt, + test Expr, + next Option, + body [#]Stmt, + }, + Return Option, Expr Expr, Decl *Decl, } -- cgit v1.2.3