aboutsummaryrefslogtreecommitdiff
path: root/src/cffc.hff
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-17 09:33:14 +0200
committerlemon <lsof@mailbox.org>2022-08-17 09:33:14 +0200
commit6e30b8a913caf1817d7e9bd0bb9783d9f7aa1ed1 (patch)
tree1a9bb65b7b695341a64f5781244bc6ecb647d155 /src/cffc.hff
parent585e51cac05cbb4fbc54ae3381bea4f41320ff5d (diff)
if and loopses
Diffstat (limited to 'src/cffc.hff')
-rw-r--r--src/cffc.hff13
1 files changed, 13 insertions, 0 deletions
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<Expr>,
+ body [#]Stmt,
+ },
+ Return Option<Expr>,
Expr Expr,
Decl *Decl,
}