aboutsummaryrefslogtreecommitdiff
path: root/src/all.hff
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-13 20:53:39 +0200
committerlemon <lsof@mailbox.org>2022-08-13 20:53:39 +0200
commitddcca62a276c528a4390c8e3d58403b865f81869 (patch)
tree3d563e173a18095501f61f3b30e39cf62b4ff521 /src/all.hff
parenta4ddca68662f4bc0531763357b4bc00b6c50b456 (diff)
ok..
Diffstat (limited to 'src/all.hff')
-rw-r--r--src/all.hff17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/all.hff b/src/all.hff
index 63ca996..4ae3e26 100644
--- a/src/all.hff
+++ b/src/all.hff
@@ -1,3 +1,4 @@
+import "mem.hff";
import "libc.hff";
import "option.hff";
@@ -26,8 +27,6 @@ defmacro foreach(x, i, a, ...body) [
}
]
-defmacro ALIGNUP(x,a) [ (((x) + ((a) - 1)) & -(a)) ]
-
defmacro streq(a,b) [ (strcmp(a,b) == 0) ]
/// Types
@@ -35,6 +34,7 @@ defmacro streq(a,b) [ (strcmp(a,b) == 0) ]
struct Type;
struct Decl;
struct Expr;
+struct Env;
struct Loc {
fileid i16,
@@ -103,13 +103,22 @@ struct Type {
struct Parser {
fp *FILE,
+ alloc *Allocator,
curfile *const u8,
tokloc Loc,
curloc Loc,
eof bool,
peekchr Option<int>,
peektok Option<Tok>,
+}
+
+struct Decl {
+ name *const u8,
+}
+struct DeclList {
+ link *DeclList,
+ decl Decl,
}
struct Targ {
@@ -150,6 +159,10 @@ extern fn efmt(fmt *const u8, ...) void;
// type.cff
+// env.cff
+extern fn mkenv(parent *Env, alloc *Allocator) *Env;
+extern fn envput(*Env, *const Decl) *Decl;
+
// targ.cff
extern static g_targ *const Targ;
extern fn targ_ini(name *const u8) bool;