aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/all.h
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-08 05:33:56 +0200
committerlemon <lsof@mailbox.org>2022-08-08 05:33:56 +0200
commitcbed5a14aa8c1624f6f350d92c1de0c9ef55e40c (patch)
treefc0c7a6877baa50bdac78e898866a0f241ed1cb6 /bootstrap/all.h
parent96ef1857bac446f4e065e7c10530213e361d726a (diff)
basic pattern matching
Diffstat (limited to 'bootstrap/all.h')
-rw-r--r--bootstrap/all.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/bootstrap/all.h b/bootstrap/all.h
index 6e63058..6055a07 100644
--- a/bootstrap/all.h
+++ b/bootstrap/all.h
@@ -136,6 +136,7 @@ struct parser {
bool is_header;
bool save_envage;
int envage;
+ int varid;
};
enum typetype {
@@ -392,6 +393,7 @@ enum stmttype {
Sfor,
Siswitch,
Sreturn,
+ Seuswitch,
};
struct iswitchcase {
@@ -399,6 +401,14 @@ struct iswitchcase {
struct blockstmt t;
};
+struct euswitchcase {
+ const char *capt;
+ int captid;
+ int vval;
+ struct aggfield *fld;
+ struct blockstmt t;
+};
+
struct stmt {
enum stmttype t;
struct span span;
@@ -422,6 +432,11 @@ struct stmt {
slice_t(struct iswitchcase) cs;
struct blockstmt *f;
} iswitch;
+ struct {
+ struct expr test;
+ slice_t(struct euswitchcase) cs;
+ struct blockstmt *f;
+ } euswitch;
struct expr *retex;
};
};