[BACK]Return to basic.in CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc / regress / roff / while

File: [cvsweb.bsd.lv] / mandoc / regress / roff / while / basic.in (download)

Revision 1.1, Fri Aug 24 23:12:35 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6, VERSION_1_14_5, HEAD

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.

.\" $OpenBSD: basic.in,v 1.1 2018/08/24 22:56:37 schwarze Exp $
.Dd $Mdocdate: August 24 2018 $
.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