From c56c17992552256b55134ead16c3e16164fd2e67 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 23 Aug 2018 14:29:38 +0000 Subject: Implement the roff(7) .shift and .return requests, for example used by groff_hdtbl(7) and groff_mom(7). Also correctly interpolate arguments during nested macro execution even after .shift and .return, implemented using a stack of argument arrays. Note that only read.c, but not roff.c can detect the end of a macro execution, and the existence of .shift implies that arguments cannot be interpolated up front, so unfortunately, this includes a partial revert of roff.c rev. 1.337, moving argument interpolation back into the function roff_res(). --- regress/roff/shift/bad.out_lint | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 regress/roff/shift/bad.out_lint (limited to 'regress/roff/shift/bad.out_lint') diff --git a/regress/roff/shift/bad.out_lint b/regress/roff/shift/bad.out_lint new file mode 100644 index 00000000..1f696fc8 --- /dev/null +++ b/regress/roff/shift/bad.out_lint @@ -0,0 +1,7 @@ +mandoc: bad.in:14:29: ERROR: using macro argument outside macro: \$1 +mandoc: bad.in:15:2: ERROR: ignoring request outside macro: shift +mandoc: bad.in:17:31: ERROR: argument number is not numeric: \$x +mandoc: bad.in:19:28: ERROR: using macro argument outside macro: \$1 +mandoc: bad.in:20:2: ERROR: ignoring request outside macro: shift +mandoc: bad.in:28:8: ERROR: argument is not numeric, using 1: shift badarg +mandoc: bad.in:28:9: ERROR: excessive shift: 2, but max is 1 -- cgit v1.2.3-56-ge451