diff options
| author | 2022-08-18 17:39:25 +0200 | |
|---|---|---|
| committer | 2022-08-18 17:39:25 +0200 | |
| commit | 9c485da5e1d955031fa2a3654bfc2ef814898167 (patch) | |
| tree | 44e841ced0479d5ec82cca28733413784eedf52c /src/cffc.hff | |
| parent | f0214ff61b5a94b9629db6f43d7a5b010bd4ffbc (diff) | |
lots of goodnes
Diffstat (limited to 'src/cffc.hff')
| -rw-r--r-- | src/cffc.hff | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/cffc.hff b/src/cffc.hff index ad6a8aa..2af06d6 100644 --- a/src/cffc.hff +++ b/src/cffc.hff @@ -111,6 +111,7 @@ struct Type { } struct Fn; +struct Expan; struct Parser { fp *FILE, alloc *Allocator, @@ -118,6 +119,8 @@ struct Parser { curfn *Fn, curenv *Env, curloop int, + curexpan *Expan, + expanno int, loopid int, targty *const Type, tokloc Loc, @@ -125,7 +128,6 @@ struct Parser { eof bool, is_header bool, peekchr Option<int>, - peektok Option<Tok>, } @@ -141,6 +143,7 @@ enum UnOp { predec, } +struct Stmt; struct Expr { loc Loc, ty *const Type, @@ -156,16 +159,21 @@ struct Expr { Cond struct { test *Expr, t *Expr, f *Expr }, Cast *Expr, Dot struct { lhs *Expr, fld *const AggField }, + SLen *Expr, + SPtr *Expr, + EUTag *Expr, Index struct { lhs *Expr, rhs *Expr }, Slice struct { lhs *Expr, begin *Expr, end *Expr }, Call struct { lhs *Expr, args [#]Expr }, ZeroIni, - Ini struct { }, + EnumIni struct { name *const u8, val i64 }, + AggIni struct { flds [#]*const AggField, exs [#]Expr }, + ArrIni struct { idxs [#]u32, exs [#]Expr, maxn i64 }, + Stmt [#]Stmt, } } -struct Stmt; struct Stmt { loc Loc, u enum union { @@ -228,6 +236,20 @@ struct Decl { myenv *Env, } +struct ExpanArg { + name *const u8, + toks [#]Tok, +} +struct Expan { + prev *Expan, + args [#]ExpanArg, + toks [#]Tok, + name *const u8, + loc Loc, + idx int, + peektok Option<Tok> +} + struct DeclList { link *DeclList, decl Decl, |