bug-groff
[Top][All Lists]
Advanced

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

[bug #45502] [troff] .if, .ie, .el parsing incompatible with Unix V7, DW


From: G. Branden Robinson
Subject: [bug #45502] [troff] .if, .ie, .el parsing incompatible with Unix V7, DWB, and Heirloom Doctools troff
Date: Thu, 22 Aug 2024 13:02:14 -0400 (EDT)

Follow-up Comment #20, bug #45502 (group groff):

Not to beat a dead horse, but...kind of, yeah.

Recently I added warning diagnostics for a numeric expression with garbage at
the end of it to the `nr` request.


$ echo '.nr a 3in' | ./build/test-groff -ww
troff:<standard input>:1: warning: expected end of line or an auto-increment
argument in register definition request; got character 'n'

...and for numeric expressions in escape sequence arguments...
$ printf '\\D@l 2.54cm 1i' | ./build/test-groff -ww -a
troff:<standard input>:1: warning: expected numeric expression, got character
'm'
<beginning of page>



Yesterday I was thinking I might do the same for one other context where
numerical expressions can appear: as predicates to `if`, `ie` and `while`
requests.

But.

The nonsense is not nonsense, but part of the branch.


$ echo '.if \na<3c.tm less than 3 centimeters' | groff -Wreg 
less than 3 centimeters
$ echo '.if \na<3c.tm less than 3 centimeters' | DWBHOME=. ./bin/troff -a #
DWB 3.3
less than 3 centimeters
$ echo '.if \na<3c.tm less than 3 centimeters' | ./bin/troff -a # Heirloom
Doctools
less than 3 centimeters
$ pdp11 ./boot.simh 

PDP-11 simulator V3.8-1
Disabling XQ
@boot
New Boot, known devices are hp ht rk rl rp tm vt 
: rl(0,0)rl2unix
mem = 177856
# Restricted rights: Use, duplication, or disclosure
is subject to restrictions stated in your contract with
Western Electric Company, Inc.
Thu Sep 22 22:19:53 EDT 1988

login: dmr
$ echo '.if \na<3c.tm less than 3 centimeters' | troff -a
less than 3 centimeters


The branch of the conditional starts *immediately* after the predicate
expression, whatever that is.

So I remain confident that this change was a correct one.


    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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