discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* Assert fails when outputting mdoc -> man with EQN
@ 2020-02-15 14:28 Stephen Gregoratto
  2020-02-15 15:17 ` Ingo Schwarze
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Gregoratto @ 2020-02-15 14:28 UTC (permalink / raw)
  To: discuss

I recently forked a simple password generator[1] and converted some
equations in the manpage[2] to eqn. For some reason, converting from
mdoc to man triggers an assertion (from the latest CVS revision):

mdoc_man.c:301: mdoc_man_act: Assertion `tok >= MDOC_Dd && tok <= MDOC_MAX' failed.

Inspecting it in GDB, we see that:

(gdb) p tok
$4 = TOKEN_NONE

[1] https://git.sgregoratto.me/rpass/
[2] https://www.sgregoratto.me/paste/rpass.1
-- 
Stephen Gregoratto
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Assert fails when outputting mdoc -> man with EQN
  2020-02-15 14:28 Assert fails when outputting mdoc -> man with EQN Stephen Gregoratto
@ 2020-02-15 15:17 ` Ingo Schwarze
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Schwarze @ 2020-02-15 15:17 UTC (permalink / raw)
  To: Stephen Gregoratto; +Cc: discuss

Hi Stephen,

Stephen Gregoratto wrote on Sun, Feb 16, 2020 at 01:28:07AM +1100:

> I recently forked a simple password generator[1] and converted some
> equations in the manpage[2] to eqn.

That's not a particularly good idea for such simple formulas.
It harms portability for little benefit.

> For some reason, converting from mdoc to man triggers an assertion

The reason is that eqn(7) and tbl(7) output modules simply do not exist.
Your eqn(7) code is parsed into an abstract syntax tree as usual,
and then that syntax tree would have to be converted back into eqn(7)
code embedded in the man(7) output, or - even more difficult - into
man(7) code proper.

Writing such eqn(7) and tbl(7) code generators would require a
non-trivial amount of work.  I added an entry to the TODO file, see
below.  But given that -T man is mostly needed for software that
wants to be unusually portable and given that using eqn(7) or tbl(7)
significantly restricts portability in the first place, this doesn't
feel like a particularly high-priority task.

Yours,
  Ingo


- -T man does not handle eqn(7) and tbl(7)
  Stephen Gregoratto 16 Feb 2020 01:28:07 +1100
  loc **  exist **  algo **  size ***  imp **
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-15 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-15 14:28 Assert fails when outputting mdoc -> man with EQN Stephen Gregoratto
2020-02-15 15:17 ` Ingo Schwarze

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).