diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2020-08-03 11:02:57 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2020-08-03 11:02:57 +0000 |
commit | c1e37572ba6067152750a7c237a80328c4cad0ee (patch) | |
tree | 09706c0c82f4fee63839ab839311b9e17bcd7337 /regress/roff/cond/close.in | |
parent | 5b4cf1561a643f1c2c419e4cc5f2d90813652057 (diff) | |
download | mandoc-c1e37572ba6067152750a7c237a80328c4cad0ee.tar.gz |
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.
Diffstat (limited to 'regress/roff/cond/close.in')
-rw-r--r-- | regress/roff/cond/close.in | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/regress/roff/cond/close.in b/regress/roff/cond/close.in index 74b402c8..3702002d 100644 --- a/regress/roff/cond/close.in +++ b/regress/roff/cond/close.in @@ -1,4 +1,4 @@ -.\" $OpenBSD: close.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ +.\" $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 @@ -12,6 +12,22 @@ closing after an ignored macro .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 @@ -28,5 +44,26 @@ 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 |