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

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

Revision 1.4, Mon Aug 3 11:02:58 2020 UTC (3 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6, HEAD
Changes since 1.3: +38 -1 lines

Put the code handling \} into a new function roff_cond_checkend()
and call that function not only from both places where copies
existed - when processing text lines and when processing request/macro
lines in conditional block scope - but also when closing a macro
definition request, such that this construction works:

.if n \{.de macroname
macro content
.. \} ignored arguments
.macroname

This fixes a bug reported by John Gardner <gardnerjohng at gmail dot com>.

While here, avoid a confusing decrement of the line scope counter
in roffnode_cleanscope() for conditional blocks that do not have
line scope in the first place (no functional change for this part).
Also improve validation of an internal invariant in roff_cblock()
and polish some comments.

.\" $OpenBSD: close.in,v 1.5 2020/08/03 10:52:39 schwarze Exp $
.TH COND-CLOSE 1 "November 26, 2018"
.SH NAME
cond-close \- closing conditional macros
.SH DESCRIPTION
.if t \{.unknown \}
closing after an unknown macro
.PP
.if t \{.ig \}
closing after an ignored macro
.PP
.if t \{text \}
closing after plain text
.PP
.if t \{text
\}
text line contains closing brace only
.PP
.if t \{text
\} plus something
text line contains closing brace and additional words
.PP
.if t \{text
.\}
request line contains closing brace only
.PP
.if t \{text
.\}with following args
request line contains closing brace and additional args
.PP
.if n \{conditional content \} following words with whitespace
.PP
.if n \{conditional content\}following words without whitespace
.PP
preceding words
.if n \{\
standard multi-line style
.\}
following words
.PP
preceding words
.if n \{
non-standard multi-line style
\}
following words
.PP
preceding words
.if n \{text line block end
\} with additional words
following words
.PP
.if n \{two
.if n \{closes
on\} the\} same
text line
.PP
preceding words
.if n \{close on request line
.\}with following args
following words
.PP
preceding words
.if n \{two
.if n \{closes
.BR\}on\}the same
macro line
.PP
.if n \{
still open at the end of the file