diff options
Diffstat (limited to 'src/all.hff')
| -rw-r--r-- | src/all.hff | 17 |
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; |