tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Subject: Re: r.i.p. MANDOCERR_SYNTLINESCOPE
Date: Mon, 07 Nov 2011 01:55:50 +0100	[thread overview]
Message-ID: <4EB72C96.6020000@bsd.lv> (raw)
In-Reply-To: <20111101215451.GW6817@iris.usta.de>

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

      reply	other threads:[~2011-11-07  0:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 21:54 Ingo Schwarze
2011-11-07  0:55 ` Kristaps Dzonsons [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EB72C96.6020000@bsd.lv \
    --to=kristaps@bsd.lv \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).