diff options
Diffstat (limited to 'src/cffc.hff')
| -rw-r--r-- | src/cffc.hff | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cffc.hff b/src/cffc.hff index 6147377..32683eb 100644 --- a/src/cffc.hff +++ b/src/cffc.hff @@ -57,6 +57,18 @@ struct Tok { }, } +enum AggKind { + Struct, + Union, + EUnion, +} + +struct AggField { + name *const u8, + ty *const Type, + off usize, +} + struct Type { size usize, align usize, @@ -75,6 +87,14 @@ struct Type { variadic bool, ret *const Type, }, + Agg struct { + kind AggKind, + name *const u8, + id int, + fwd bool, + flds [#]AggField, + decls [#]*Decl, + }, }, fn is(ty *const Type, tag typeof((Type{}).u.#tag)) bool { @@ -172,6 +192,7 @@ struct Decl { u enum union { Let Var, Static Var, + Def Expr, Fn Fn, Ty *const Type, }, @@ -289,4 +310,5 @@ extern fn mkenv(parent *Env, alloc *Allocator) *Env; extern fn envparent(*Env) *Env; extern fn envput(*Env, Decl, **const Decl) *Decl; extern fn envfind(*Env, *const u8) *Decl; +extern fn envfind_noparent(*Env, *const u8) *Decl; extern fn envfree(*Env) void; |