Follow-up Comment #24, bug #65474 (group groff):

[comment #23 comment #23:]
> [comment #11 comment #11:]
> > Solaris 10 /usr/bin/nroff outputs "CASE a", which is what I'd expect.
> 
> Heirloom troff does as well.
> 
> > gnroff outputs "NOTREACHED", which is surprising.
> 
> My guess at the end of comment #16 was wrong.  This, it turns out, is an
application of bug #45502.  In a nutshell, groff diverges from other troffs
when given an .if or .ie with an empty branch (no content after the
conditional), which is what the ". ie '1'2'" line has.  Put any content after
that test, and all the troffs produce the same output.

I think my recast[1] of the relevant material in our Texinfo manual is a
reliable guide to interpretation.


5.23.2 if-then
--------------

 -- Request: .if cond-expr anything
     Evaluate the conditional expression COND-EXPR, and if it evaluates
     true (or to a positive value), interpret the remainder of the line
     ANYTHING as if it were an input line.  Recall from *note Invoking
     Requests:: that any quantity of spaces between arguments to
     requests serves only to separate them; leading spaces in ANYTHING
     are thus not seen.  ANYTHING effectively _cannot_ be omitted; if
     COND-EXPR is true and ANYTHING is empty, the newline at the end of
     the control line is interpreted as a blank input line (and
     therefore a blank text line).

          super\c
          tanker
          .nr force-word-break 1
          super\c
          .if ((\n[force-word-break] = 1) & \n[.int])
          tanker
              => supertanker super tanker


[1] from September 2022,
[https://git.savannah.gnu.org/cgit/groff.git/commit/?id=66b7cb51ba9439f8a93cef1ea4e44b6d11a952df
commit 66b7cb51ba]


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65474>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/


Reply via email to