aboutsummaryrefslogtreecommitdiffstats
path: root/testcases-narg
diff options
context:
space:
mode:
Diffstat (limited to 'testcases-narg')
-rw-r--r--testcases-narg13
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]