[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: |
Sat, 14 Sep 2024 10:44:48 -0400 (EDT) |
Follow-up Comment #21, bug #45502 (group groff):
[comment #16 comment #16:]
> The branch portion of a control flow request in *roff is read _as if it were
on an input line by itself_.
I'd like to point out a _roff_-grammatical parallel here.
Consider this example, originally from bug #65474, comment #27.
$ cat EXPERIMENTS/empty-branch.roff
foo\c
.if \nA \{\}
bar
$ nroff EXPERIMENTS/empty-branch.roff | cat -s
foobar
$ nroff -rA1 EXPERIMENTS/empty-branch.roff | cat -s
foo bar
One might wonder why the `-rA1` case behaves the way it does.
Just look at those brace escape sequences enclosing stuff! Doesn't that mean
the true branch is empty?
Well, they do enclose stuff but that doesn't make the branch empty.
Consider how it reads once the brace escape sequences are parsed away.
foo\c
.if \nA
bar
...and we're right back to the "super tanker" behavior of comment #18 here.
What's the parallel? Why, this right here.
I'm gonna git good 'n' liquored up and drive my super\c
\" Legal says STRIKE THIS WHOLE PARAGRAPH
tanker through Prince William Sound!
As our Texinfo manual is at pains to point out...
5.7 Comments
============
One of the most common forms of escape sequence is the comment.(1)
(*note Comments-Footnote-1::)
...
A '\"' comment on a line by itself is treated as a blank line,
because after eliminating the comment, that is all that remains.
Test
\" comment
Test
=> Test
=>
=> Test
...the syntactical significance of newlines in _roff_ surprises people used to
more flexible languages like C or Perl.
And yes, I may be coming to resemble one of my own _.signature_ file
quotations from 20-30 years ago.
> It was a typical net.exercise – a screaming mob
> pounding on a greasy spot on the pavement,
> where used to lie the carcass of a dead horse.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?45502>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #45502] [troff] .if, .ie, .el parsing incompatible with Unix V7, DWB, and Heirloom Doctools troff,
G. Branden Robinson <=