From: Ingo Schwarze <schwarze@usta.de>
To: nabijaczleweli@nabijaczleweli.xyz
Cc: tech@mandoc.bsd.lv
Subject: Re: eqn delimiters break conditionals
Date: Thu, 9 Sep 2021 14:21:53 +0200 [thread overview]
Message-ID: <20210909122153.GC55767@athene.usta.de> (raw)
In-Reply-To: <20210908132448.xknl7noihywihkdh@tarta.nabijaczleweli.xyz>
Hi,
Nab wrote on Wed, Sep 08, 2021 at 03:24:48PM +0200:
> Consider the following file:
> -- >8 --
> .EQ
> delim %%
> .EN
> .if 0 A % B % C
> .if 1 D % E % F
> -- >8 --
[...]
> However, mandoc (1.14.4-1 and latest CVS as of an hour ago) does not:
> -- >8 --
> $ ./mandoc < a.1 | grep -v '^$'
> () ()
> B C D E F
> ()
> -- >8 --
[..]
> This smells like a bug to me, for reasons I assume obvious.
Yes, that is a bug, and it was so far unknown, too.
The reason for the bug is that roff.c implements eqn(7) delim
by replacing delimited equations with .EQ/.EN blocks on the fly,
and then they are no longer on the conditional line.
Fixing it requires to either implement delim in a completely
different way, which would cause very major code changes.
Or the delim handling could possibly be moved after the handling
of conditionals in roff_parseln(). But the code in that function
is very prone to regressions.
Consequently, i won't attempt fixing this bug before the upcoming
release, the risk of breaking the release in a way that might be
even worse is too high, and besides, this causes too much effort
to be resolved before release.
Instead, i'm adding an entry to the TODO file:
- eqn(7) delimiters cause conditional lines to misbehave
nabijaczleweli 8 Sep 2021 15:24:48 +0200
loc * exist *** algo *** size * imp *
Thanks for reporting!
Ingo
--
To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv
next prev parent reply other threads:[~2021-09-09 12:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-08 13:24 наб
2021-09-09 12:21 ` Ingo Schwarze [this message]
2021-09-09 17:12 ` наб
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=20210909122153.GC55767@athene.usta.de \
--to=schwarze@usta.de \
--cc=nabijaczleweli@nabijaczleweli.xyz \
--cc=tech@mandoc.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).