[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] condition: OR of two string comparisons

From: Tadziu Hoffmann
Subject: Re: [Groff] condition: OR of two string comparisons
Date: Mon, 17 Nov 2014 13:43:26 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

> Maybe I'm missing something, but from here it looks possible.
> True, you need a stack, but not very much, and no look-ahead.
> [...]

Indeed, if you terminate the block with an explicit "endif",
this will be no problem.  But it might create new ones.
For example: will groff need to parse the whole block until the
"endif" before processing anything, or can it start processing
line-by-line, as is *roff tradition?
What about the following situation:

  .de zz
  .if '\\$1'aa' \{.nr nn +1
  .am xx yy\}


  .de zz
  .if '\\$1'aa'
  .nr nn +1
  .am xx yy

Does .endif need to be treated specially, or does it get
appended to macro xx?  What about an .endif that is read
from the input stream?  Will redefining .endif be allowed?

> Branches don't usually nest very deeply, and "else" is useful
> functionality.  

I thought the whole idea of if/elseif/else/endif was about
improving the clarity of deeply nested conditionals?
Otherwise the existing syntax is sufficient...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]