diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-08-24 23:12:33 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-08-24 23:12:33 +0000 |
commit | f5133ff5de286c3849ba772719280fcec35ca374 (patch) | |
tree | d010611a454ce17650edf5bc7d26c9d237d10c00 /regress/roff/while/basic.in | |
parent | 0278f391fed9ab1da96a2f7737b052872f5ced71 (diff) | |
download | mandoc-f5133ff5de286c3849ba772719280fcec35ca374.tar.gz |
Rudimentary implementation of the roff(7) .while request.
Needed for example by groff_hdtbl(7).
There are two limitations:
It does not support nested .while requests yet,
and each .while loop must start and end in the same scope.
The roff_parseln() return codes are now more flexible
and allow OR'ing options.
Diffstat (limited to 'regress/roff/while/basic.in')
-rw-r--r-- | regress/roff/while/basic.in | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/regress/roff/while/basic.in b/regress/roff/while/basic.in new file mode 100644 index 00000000..07cd1282 --- /dev/null +++ b/regress/roff/while/basic.in @@ -0,0 +1,30 @@ +.\" $OpenBSD: basic.in,v 1.1 2018/08/24 22:56:37 schwarze Exp $ +.Dd $Mdocdate$ +.Dt WHILE-BASIC 1 +.Os +.Sh NAME +.Nm while-basic +.Nd the while request +.Sh DESCRIPTION +Loop with single-line scope: +.nr cnt 11 1 +.de mym +\\n-[cnt] +.. +.while \n[cnt] .mym +.Pp +Loop with multi-line scope, text line closure: +.nr cnt 11 +.while \n[cnt] \{\ +.nr cnt -1 +\n[cnt]\}, +boom. +.Pp +Loop with multi-line scope, macro line closure: +.nr cnt 11 +.while \n[cnt] \{\ +.nr cnt -1 +\n[cnt] +.\} +.Pp +final text |