aboutsummaryrefslogtreecommitdiff
path: root/src/cffc.hff
diff options
context:
space:
mode:
Diffstat (limited to 'src/cffc.hff')
-rw-r--r--src/cffc.hff28
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,