diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-03-29 07:02:37 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-03-29 07:02:37 -0700 |
commit | 4955c31e0b97fa5d0ac866df2db08bb390845a30 (patch) | |
tree | c1677eb5a2ecc541dedbac516f8910097140ff9f /cppawk-include/case-priv.h | |
parent | c2287bfb8bdf1648ec2683b1a8e96547fcb43513 (diff) | |
download | cppawk-4955c31e0b97fa5d0ac866df2db08bb390845a30.tar.gz cppawk-4955c31e0b97fa5d0ac866df2db08bb390845a30.tar.bz2 cppawk-4955c31e0b97fa5d0ac866df2db08bb390845a30.zip |
case: add mixed clause.
Diffstat (limited to 'cppawk-include/case-priv.h')
-rw-r--r-- | cppawk-include/case-priv.h | 9 |
1 files changed, 9 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 }}} |