aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/regress
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-04-10 00:52:30 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-04-10 00:52:30 +0000
commitaa23a004eb502cf67af388be4976d369784961db (patch)
treefb861ca062ad13e28b814094efecbf58be3f4131 /regress
parent318dcfc920386cbcdf23d6d81d97b72fabb8de35 (diff)
downloadmandoc-aa23a004eb502cf67af388be4976d369784961db.tar.gz
mandoc-aa23a004eb502cf67af388be4976d369784961db.tar.zst
mandoc-aa23a004eb502cf67af388be4976d369784961db.zip
Two new low-level roff(7) features:
* .nr optional third argument (auto-increment step size) * \n+ and \n- numerical register auto-increment and -decrement bentley@ reported on Dec 9, 2013 that lang/sbcl(1) uses these.
Diffstat (limited to 'regress')
-rw-r--r--regress/roff/nr/Makefile2
-rw-r--r--regress/roff/nr/incr.in30
-rw-r--r--regress/roff/nr/incr.out_ascii19
3 files changed, 50 insertions, 1 deletions
diff --git a/regress/roff/nr/Makefile b/regress/roff/nr/Makefile
index b3ba8102..562a5f30 100644
--- a/regress/roff/nr/Makefile
+++ b/regress/roff/nr/Makefile
@@ -1,6 +1,6 @@
# $OpenBSD: Makefile,v 1.9 2015/01/23 00:38:43 schwarze Exp $
-REGRESS_TARGETS = argc divzero escname eval int predef rr scale undef
+REGRESS_TARGETS = argc divzero escname eval incr int predef rr scale undef
LINT_TARGETS = divzero escname
.include <bsd.regress.mk>
diff --git a/regress/roff/nr/incr.in b/regress/roff/nr/incr.in
new file mode 100644
index 00000000..a03493ff
--- /dev/null
+++ b/regress/roff/nr/incr.in
@@ -0,0 +1,30 @@
+.\" $OpenBSD: undef.in,v 1.1 2018/04/09 22:26:25 schwarze Exp $
+.TH NR-INCR 1 "April 10, 2018"
+.SH NAME
+nr-incr \- increment a number register by accessing it
+.SH DESCRIPTION
+.nr myr 0 1
+Roff can count by merely accessing a number register:
+\n+[myr]
+\n+[myr]
+\n+[myr]
+.PP
+.nr myr +0 1+1
+It can also change the step size:
+\n+[myr]
+\n+[myr]
+\n+[myr]
+.PP
+.nr myr +0 3
+It can also count down:
+\n-[myr]
+\n-[myr]
+\n-[myr]
+\n-[myr]
+.PP
+.nr myr -0 -2
+Down in negative steps is up:
+\n-[myr]
+\n-[myr]
+\n-[myr]
+\n-[myr]
diff --git a/regress/roff/nr/incr.out_ascii b/regress/roff/nr/incr.out_ascii
new file mode 100644
index 00000000..d039d5b1
--- /dev/null
+++ b/regress/roff/nr/incr.out_ascii
@@ -0,0 +1,19 @@
+NR-INCR(1) General Commands Manual NR-INCR(1)
+
+
+
+NNAAMMEE
+ nr-incr - increment a number register by accessing it
+
+DDEESSCCRRIIPPTTIIOONN
+ Roff can count by merely accessing a number register: 1 2 3
+
+ It can also change the step size: 5 7 9
+
+ It can also count down: 6 3 0 -3
+
+ Down in negative steps is up: -1 1 3 5
+
+
+
+OpenBSD April 10, 2018 NR-INCR(1)