tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: "tech@mdocml.bsd.lv" <tech@mdocml.bsd.lv>
Subject: Re: Symbols and troff conditionals
Date: Thu, 10 Jun 2010 23:42:16 +0200	[thread overview]
Message-ID: <4C115C38.8050603@bsd.lv> (raw)
In-Reply-To: <4C1152F3.2010407@bsd.lv>

Kristaps Dzonsons wrote:
> Hi Ulrich, these aren't really regressions, but rather unsupported 
> behaviour.  mandoc(1) isn't smart enough to do full conditional 
> evaluation, so, and I'll note it in the file...
> 
>> .if n\
>> (r,theta)
>> .if t\
>> (r,\(*h)
> 
> after line concatenation looks like
> 
> .if n(r,theta)
> .if t(r,\(*h)
> 
> to mandoc, which subsequently barfs because it reads conditionals as 
> text up until space or eoln.  So the conditional is "n(r,theta)", which 
> is true as "n" is first, but obviously there's no body except for the 
> subsequent "if".

Ok, I made it a tad bit smarter.  Now, from roff.7:

      COND is a conditional statement.  roff allows for complicated
      conditionals; mandoc is much simpler.  At this time, mandoc
      supports only `n', evaluating to true; and `t', `e', and `o',
      evaluating to false.  All other invocations are read up to the
      next end of line or space and evaluate as false.

Thus, the `n' is correctly parsed, in your example, and it spits out the 
correct manual.  I added a regression test to this effect.

Thanks,

Kristaps
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

      reply	other threads:[~2010-06-10 21:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-09 16:28 Ulrich Spörlein
2010-06-09 19:32 ` Kristaps Dzonsons
2010-06-09 20:11 ` Kristaps Dzonsons
2010-06-10  6:32   ` Ulrich Spörlein
2010-06-10 21:02     ` Kristaps Dzonsons
2010-06-10 21:42       ` 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=4C115C38.8050603@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).