macro: Allow macro A to use its arguments as part of call to macro B.
[pspp] / tests / language / control / define.at
index 9e1483ad82dab175ec3f339d221d58a18732f8c1..bad9c15cbcd49ec36ed02b43d3761558b8b13a62 100644 (file)
@@ -2058,4 +2058,20 @@ positive integer for N OF CASES.
 define.sps:17.12-17.22: error: N OF CASES: Syntax error at `!minus !one':
 Expected positive integer for N OF CASES.
 ])
+AT_CLEANUP
+
+AT_SETUP([one macro calls another])
+AT_DATA([define.sps], [dnl
+DEFINE !a(!pos !enclose('(',')')) [[!1]] !ENDDEFINE.
+DEFINE !b(!pos !enclose('{','}')) !a(x !1 z) !ENDDEFINE.
+DEFINE !c(!pos !enclose('{','}')) !let !tmp=!quote(!concat('<',!1,'>')) !a(!tmp) !ENDDEFINE.
+DEBUG EXPAND.
+!b{y}.
+!c{y}.
+])
+AT_CHECK([pspp --testing-mode define.sps], [0], [dnl
+[[x y z]]
+
+[[ < y > ]]
+])
 AT_CLEANUP
\ No newline at end of file