aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/all.h
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-20 06:31:06 +0200
committerlemon <lsof@mailbox.org>2022-08-20 06:31:06 +0200
commit19acdd751963e88b6e75693f947b1b1fd2912f11 (patch)
treee276d518a6eee672d3b2f32381fb41b544a9d6c7 /bootstrap/all.h
parent58d8abf355c1543ec6afd99189848634f51f6273 (diff)
defer
Diffstat (limited to 'bootstrap/all.h')
-rw-r--r--bootstrap/all.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/bootstrap/all.h b/bootstrap/all.h
index 1bfe919..64ab9b1 100644
--- a/bootstrap/all.h
+++ b/bootstrap/all.h
@@ -38,6 +38,7 @@ struct span {
_(const) \
_(continue) \
_(def) \
+ _(defer) \
_(defmacro) \
_(do) \
_(else) \
@@ -125,6 +126,7 @@ struct parser {
struct env *primenv;
struct env *tlenv;
struct env *curenv;
+ struct blockstmt *curblock;
struct fn *curfn;
struct expan {
struct expan *prev;
@@ -343,6 +345,7 @@ enum exprtype {
struct blockstmt {
struct env env;
slice_t(struct stmt) stmts;
+ struct defer *defers;
};
struct expr {
@@ -475,7 +478,10 @@ struct stmt {
struct blockstmt *f;
bool byptr;
} euswitch;
- struct expr *retex;
+ struct {
+ struct expr *ex;
+ int deferage;
+ } ret;
struct {
int id;
} brkcon;
@@ -488,6 +494,11 @@ struct stmt {
} cswitch;
};
};
+struct defer {
+ struct defer *next;
+ int age;
+ struct expr ex;
+} ;
struct comfile {
slice_t(struct decl *) decls;