aboutsummaryrefslogtreecommitdiffstats
path: root/cppawk-include
diff options
context:
space:
mode:
Diffstat (limited to 'cppawk-include')
-rw-r--r--cppawk-include/case-priv.h9
-rw-r--r--cppawk-include/case.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/cppawk-include/case-priv.h b/cppawk-include/case-priv.h
index 2d99533..6421877 100644
--- a/cppawk-include/case-priv.h
+++ b/cppawk-include/case-priv.h
@@ -41,10 +41,15 @@
#define __ca_first(x) case x:
#define __ca_next(p, x) p case x:
+#define __mx_first(x) __of(x)
+#define __mx_next(p, x) p case x:
+
#define __case_temps __ign
#define __case(expr) switch (expr)
#define __of(...) __varexpand(__ca_first, __ca_next, __VA_ARGS__) {{{
#define __matching(...) __varexpand(__ca_first, __ca_next, __VA_ARGS__) {{{
+#define __mixed(x, y) __varexpand(__ca_first, __ca_next, __splice(x)) \
+ __varexpand(__ca_first, __ca_next, __splice(y)) {{{
#define __cbreak break; }}}
#define __cfall }}}
#define __cret(val) return val; }}}
@@ -67,6 +72,10 @@
__VA_ARGS__)) {{{
#define __matching(...) __clause(__varexpand(__mtch_first, mtch_next, \
__VA_ARGS__)) {{{
+#define __mixed(x, y) __clause(__varexpand(__of_first, __of_next, \
+ __splice(x)) || \
+ __varexpand(__mtch_first, __mtch_next, \
+ __splice(y))) {{{
#define __cbreak break; }}}
#define __creturn(val) return val; }}}
#define __cfall }}}
diff --git a/cppawk-include/case.h b/cppawk-include/case.h
index 79a04b8..42eb7ae 100644
--- a/cppawk-include/case.h
+++ b/cppawk-include/case.h
@@ -36,6 +36,7 @@
#define case(expr) __case(expr)
#define of(...) __of(__VA_ARGS__)
#define matching(...) __matching(__VA_ARGS__)
+#define mixed(...) __mixed(__VA_ARGS__)
#define cbreak __cbreak
#define cfall __cfall
#define cret(val) __cret(val)