From 16d4788cef7bb58fdc8820bdd5ecb511933f0d15 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 3 Aug 2020 11:02:57 +0000 Subject: 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 . 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. --- regress/roff/cond/close.out_ascii | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'regress/roff/cond/close.out_ascii') diff --git a/regress/roff/cond/close.out_ascii b/regress/roff/cond/close.out_ascii index d049154d..63484540 100644 --- a/regress/roff/cond/close.out_ascii +++ b/regress/roff/cond/close.out_ascii @@ -12,6 +12,14 @@ DDEESSCCRRIIPPTTIIOONN closing after plain text + text line contains closing brace only + + text line contains closing brace and additional words + + request line contains closing brace only + + request line contains closing brace and additional args + conditional content following words with whitespace conditional contentfollowing words without whitespace @@ -22,6 +30,15 @@ DDEESSCCRRIIPPTTIIOONN non-standard multi-line style following words + preceding words text line block end with additional words following + words + + two closes on the same text line + + preceding words close on request line following words + + preceding words two closes oonntthheesame macro line + still open at the end of the file -- cgit v1.2.3-56-ge451