diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-04-07 22:07:39 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-04-07 22:07:39 -0700 |
commit | 768e1ae91c76af878dbbd93833ad49ae98da6260 (patch) | |
tree | a697790e2e263837e426a1b9310782358f1c0a3f /testcases-narg | |
parent | 3c3991533abf3d32606f11016cfaf94aa0a85235 (diff) | |
download | cppawk-768e1ae91c76af878dbbd93833ad49ae98da6260.tar.gz cppawk-768e1ae91c76af878dbbd93833ad49ae98da6260.tar.bz2 cppawk-768e1ae91c76af878dbbd93833ad49ae98da6260.zip |
narg: new variexpand macro.
Diffstat (limited to 'testcases-narg')
-rw-r--r-- | testcases-narg | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/testcases-narg b/testcases-narg index 9f8f55c..97baac1 100644 --- a/testcases-narg +++ b/testcases-narg @@ -70,3 +70,16 @@ done echo okay : okay +-- +7: +$cppawk ' +#include <narg.h> +#define first(x, i) x ## i +#define rest(prev, x, i) prev : x ## i +#define colonize(...) [variexpand(first, rest, __VA_ARGS__)] +#define str(x) #x +#define xstr(x) str(x) +#define scolonize(...) xstr(colonize(__VA_ARGS__)) +BEGIN { print scolonize(a), scolonize(a, b), scolonize(a, b, c) }' +: +[a1] [a1 : b2] [a1 : b2 : c3] |