aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/all.h
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-04 07:39:23 +0200
committerlemon <lsof@mailbox.org>2022-08-04 07:39:23 +0200
commitbb1d4b4a3e51a06fb0530dfc271a97a6cd88cc73 (patch)
treef300325814bc30e64f858ee313b8260a14d8df90 /bootstrap/all.h
parent1625c50f0c0e4b1c7ba01a5df5713efaf6dce606 (diff)
stuff
Diffstat (limited to 'bootstrap/all.h')
-rw-r--r--bootstrap/all.h58
1 files changed, 32 insertions, 26 deletions
diff --git a/bootstrap/all.h b/bootstrap/all.h
index 7f26372..6b5fd7d 100644
--- a/bootstrap/all.h
+++ b/bootstrap/all.h
@@ -29,25 +29,26 @@ struct span {
/* must be alpha sorted */
#define LIST_KEYWORDS(_) \
- _(and) \
- _(break) \
- _(case) \
- _(const) \
- _(defmacro) \
- _(do) \
- _(else) \
- _(extern) \
- _(fn) \
- _(for) \
- _(if) \
- _(let) \
- _(not) \
- _(or) \
- _(return) \
- _(switch) \
- _(typedef) \
- _(typeof) \
- _(while) \
+ _(and) \
+ _(break) \
+ _(case) \
+ _(const) \
+ _(defmacro) \
+ _(do) \
+ _(else) \
+ _(extern) \
+ _(fn) \
+ _(for) \
+ _(if) \
+ _(let) \
+ _(not) \
+ _(or) \
+ _(return) \
+ _(static) \
+ _(switch) \
+ _(typedef) \
+ _(typeof) \
+ _(while)
enum toktype {
#define KWTK(kw) TKkw_##kw,
@@ -60,6 +61,7 @@ enum toktype {
TKchrlit,
TKnullit,
TKident,
+ TKmacident,
TKgensym,
TKeof,
NUM_LEXTOKENS
@@ -179,7 +181,8 @@ struct macro {
enum decltype {
Dtype,
Dfn,
- Dvar,
+ Dlet,
+ Dstatic,
Dmacro,
};
@@ -192,7 +195,7 @@ struct decl {
union {
const struct type *ty;
struct fn fn;
- struct {
+ struct var {
const struct type *ty;
struct expr *ini;
int fnid;
@@ -221,6 +224,12 @@ enum exprtype {
Econd,
Ecall,
Eindex,
+ Eblock,
+};
+
+struct blockstmt {
+ struct env env;
+ slice_t(struct stmt) stmts;
};
struct expr {
@@ -253,6 +262,7 @@ struct expr {
struct {
struct expr *lhs, *rhs;
} index;
+ struct blockstmt block;
};
};
@@ -267,11 +277,6 @@ enum stmttype {
Sreturn,
};
-struct blockstmt {
- struct env env;
- slice_t(struct stmt) stmts;
-};
-
struct iswitchcase {
slice_t(struct expr) es;
struct blockstmt t;
@@ -279,6 +284,7 @@ struct iswitchcase {
struct stmt {
enum stmttype t;
+ struct span span;
union {
struct blockstmt block;
struct expr expr;