aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.1
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-08-23 14:29:38 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-08-23 14:29:38 +0000
commitc56c17992552256b55134ead16c3e16164fd2e67 (patch)
treecfe287e6cfd33a9dcb04a6a781b093af17e5b556 /mandoc.1
parent1483cf671448b44a8bf37ea7129c88e24f588abd (diff)
downloadmandoc-c56c17992552256b55134ead16c3e16164fd2e67.tar.gz
mandoc-c56c17992552256b55134ead16c3e16164fd2e67.tar.zst
mandoc-c56c17992552256b55134ead16c3e16164fd2e67.zip
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().
Diffstat (limited to 'mandoc.1')
-rw-r--r--mandoc.126
1 files changed, 24 insertions, 2 deletions
diff --git a/mandoc.1 b/mandoc.1
index 76b3cda5..a93d1d43 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc.1,v 1.226 2018/07/28 18:34:15 schwarze Exp $
+.\" $Id: mandoc.1,v 1.227 2018/08/23 14:29:38 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2012, 2014-2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: July 28 2018 $
+.Dd $Mdocdate: August 23 2018 $
.Dt MANDOC 1
.Os
.Sh NAME
@@ -1807,6 +1807,13 @@ or
macro.
It may be mistyped or unsupported.
The request or macro is discarded including its arguments.
+.It Sy "skipping request outside macro"
+.Pq roff
+A
+.Ic shift
+or
+.Ic return
+request occurs outside any macro definition and has no effect.
.It Sy "skipping insecure request"
.Pq roff
An input file attempted to run a shell command
@@ -1916,6 +1923,14 @@ When parsing for a request or a user-defined macro name to be called,
only the escape sequence is discarded.
The characters preceding it are used as the request or macro name,
the characters following it are used as the arguments to the request or macro.
+.It Sy "using macro argument outside macro"
+.Pq roff
+The escape sequence \e$ occurs outside any macro definition
+and expands to the empty string.
+.It Sy "argument number is not numeric"
+.Pq roff
+The argument of the escape sequence \e$ is not a digit;
+the escape sequence expands to the empty string.
.It Sy "NOT IMPLEMENTED: Bd -file"
.Pq mdoc
For security reasons, the
@@ -1978,6 +1993,13 @@ or
.Ic \&gsize
statement has a non-numeric or negative argument or no argument at all.
The invalid request or statement is ignored.
+.It Sy "excessive shift"
+.Pq roff
+The argument of a
+.Ic shift
+request is larger than the number of arguments of the macro that is
+currently being executed.
+All macro arguments are deleted and \en(.$ is set to zero.
.It Sy "NOT IMPLEMENTED: .so with absolute path or \(dq..\(dq"
.Pq roff
For security reasons,