!ENDDEFINE.
!macro.
])
-AT_CHECK([pspp define.sps], [1], [dnl
+AT_CHECK([pspp -O format=csv define.sps], [1], [dnl
maximum nesting level exceeded
-define.sps.1: error: Syntax error at `!macro': expecting command name.
+define.sps:4.1-4.6: error: Syntax error at `!macro' (in expansion of `!macro'): expecting command name.
])
AT_CLEANUP
DEFINE !paste(!POS !TOKENS(1) / !POS !TOKENS(1))
!CONCAT(!1,!2)
!ENDDEFINE.
-$command prefix !paste foo bar.
+$command prefix !paste foo bar suffix.
SHOW $command.
EOF
cat >expout <<EOF
-title.sps:2: note: SHOW: $command is foo bar.
+title.sps:5: note: SHOW: $command is prefix foobar suffix.
EOF
AT_CHECK([pspp -O format=csv title.sps], [0], [expout])
done
+AT_CLEANUP
+
+AT_SETUP([error message within macro expansion])
+AT_DATA([define.sps], [dnl
+DEFINE !vars(!POS !TOKENS(1)) a b C !ENDDEFINE.
+DATA LIST NOTABLE /a b 1-2.
+COMPUTE x = !vars x.
+])
+AT_CHECK([pspp -O format=csv define.sps], [1], [dnl
+define.sps:3.13-3.19: error: COMPUTE: Syntax error at `b' (in expansion of `!vars x'): expecting end of command.
+])
AT_CLEANUP
\ No newline at end of file