bugGNU roff - Bugs: bug #45502, .if, .ie, .el parsing incompatible...

 
 

bug #45502: .if, .ie, .el parsing incompatible with V7 Unix & Heirloom troff

Submitter:  Carsten Kunze <carstenkunze>
Submitted:  Thu 09 Jul 2015 03:26:27 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 12 May 2021 08:16:03 PM UTC, comment #3: 

FWIW, when this was brought up on the email list at the time (http://lists.gnu.org/archive/html/groff/2015-07/msg00012.html) it elicited no responses.

Dave <barx>
Group Member
Tue 11 May 2021 11:40:04 PM UTC, comment #2: 

Does strictly enforcing the V7 Unix troff syntax offer any compatibility benefit?  That is, are there correctly formed historical constructions that would be parsed incorrectly under groff as a result of this change?

I ask because changing groff's behavior 30 years on (assuming this behavior dates to groff 1.0) also poses back-compatibility concerns for those authors (perhaps unwittingly) taking advantage of this undocumented syntactical relaxation.

Maybe the right solution is to document this as a GNU extension to traditional troff syntax.  As long as it breaks no valid historical documents, it seems a pretty clear-cut case of DWIM.

Dave <barx>
Group Member
Tue 16 Mar 2021 02:29:47 AM UTC, comment #1: 

Confirmed.

Output from V7 Unix nroff and Heirloom Doctools 191015 troff is as Carsten's example of correct output, with added newlines (maybe Savannah stripped them)?


$ pdp11

PDP-11 simulator V3.8-1
sim> set cpu 11/45
Disabling XQ
sim> set tto 7b
sim> att rl unix_v7_rl.dsk
sim> boot rl
@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 05:50:28 EDT 1988

login: dmr
$ cat > carsten.roff
.pl 5
.de A
. ie \\$1
. tm \\$1: true
. el
. tm \\$1: false
..
.A 0
.A 1
$ nroff carsten.roff
0: true

0: false

1: true
1: false



$


G. Branden Robinson <gbranden>
Group administrator
Thu 09 Jul 2015 03:26:27 PM UTC, original submission:  

Specification:  The conditionally processed commands or text need to follow ".if expr", ".ie expr", and ".el" separated by space on the same line (i.e. .ie <expr> <anything>).

Wrong behaviour:  If ".if expr", ".ie expr", or ".el" is followed by nothing on a line the next line is executed conditionally.

This is not compliant with the specified syntax and leads to documents where this wrong syntax is not noticed (since it works).

Example:

.pl 5
.de A
. ie \\$1
. tm \\$1: true
. el
. tm \\$1: false
..
.A 0
.A 1

The output is

0: false
1: true

whereas the expected (stderr) output would be

0: true
0: false
1: true
1: false

Since the .ie and .el statements have a wrong syntax the following line needs to be processed unconditionally.

Additionally a warning could be output for the lines with wrong syntax.

Carsten Kunze <carstenkunze>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by carstenkunze (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-05-14 barx CategoryNone Core
    2021-03-16 gbranden StatusNone Confirmed
        Summary.if, .ie, .el syntax issue .if, .ie, .el parsing incompatible with V7 Unix & Heirloom troff

    Back to the top

    Powered by Savane 3.13.
    Corresponding source code