From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-2.sys.kth.se (smtp-2.sys.kth.se [130.237.32.160]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id pA70u1fo010595 for ; Sun, 6 Nov 2011 19:56:02 -0500 (EST) Received: from mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 6BCC914DC4B for ; Mon, 7 Nov 2011 01:55:55 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([130.237.32.160]) by mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) (amavisd-new, port 10024) with LMTP id 8Zi6CZIFv95I for ; Mon, 7 Nov 2011 01:55:54 +0100 (CET) X-KTH-Auth: kristaps [83.250.3.9] X-KTH-mail-from: kristaps@bsd.lv X-KTH-rcpt-to: tech@mdocml.bsd.lv Received: from macky.local (c83-250-3-9.bredband.comhem.se [83.250.3.9]) by smtp-2.sys.kth.se (Postfix) with ESMTP id CC9AD14D7D6 for ; Mon, 7 Nov 2011 01:55:52 +0100 (CET) Message-ID: <4EB72C96.6020000@bsd.lv> Date: Mon, 07 Nov 2011 01:55:50 +0100 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv Subject: Re: r.i.p. MANDOCERR_SYNTLINESCOPE References: <20111101215451.GW6817@iris.usta.de> In-Reply-To: <20111101215451.GW6817@iris.usta.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 01/11/2011 22:54, Ingo Schwarze wrote: > Hi, > > here is a long-awaited patch to fix one of the last needless > fatal errors that sometimes haunt us in real-world manuals: > When breaking a man(7) BLINE scope, do not error out, > but instead just delete the clobbered macro from the AST. > > This fixes rendition(4) in Xenocara. > > I see no regressions. > > > The patch is mildly tricky. > > In man_validate, it is too late to fix this. > Consider: > > .SH FOO > lots of stuff > .TP > .SH BAR > > That produces this AST: > > .SH BLOCK > .SH HEAD: FOO > .SH BODY > lots of stuff > .TP BLOCK > .TP HEAD (empty, and BODY is missing, ouch) > .SH BLOCK > .SH HEAD: BAR > > The current check_bline is called while parsing the BAR BLOCK. > So m->last is already pointing to BAR, and there is no reasonable > way to get back to the utterly broken, incomplete TP block: > prev -> child -> next -> child, and iterate the next pointers > until the last? Certainly not. > > So the interrupted BLINE block has to be killed when starting > the interrupting macro parse sequence in man_pmacro, just like > it is done for interrupted ELINE macros. > > That gets rid of lots of hooks in man_validate.c, but requires > a new parse flag for those macros losing the check_bline hook. Ingo, Yes, I like this---please commit it. Thanks! Kristaps -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv