[Top][All Lists]

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

bug: \} in .nr

From: Steve Summit
Subject: bug: \} in .nr
Date: Sun, 10 Dec 2000 07:03:42 -0800 (PST)

If an .nr directive appears as the last line of a brace-enclosed
.if, .ie, or .el block, and if the closing \} appears on the same
line as the .nr directive, GNU troff with warnings enabled
incorrectly complains about "`\}' where number expected".
This is with GNU troff version 1.15.

A workaround is to explicitly specify an autoincrement value for
the number register.  Obviously the bug is that the readahead
function which the .nr directive calls to discover if it's been
given its optional third argument is not properly interlocked
with \{ \} scanning.

Other workarounds are to end the \{ \} block with something other
than an .nr request, or to place the \} on a line by itself
(though of course this can lead to spurious output).

This typescript includes five tests which demonstrate the
presence of the bug, along with the workarounds:

Script started on Sun Dec 10 08:14:12 2000
linux> cat gt2
.if 1 \{\
.nr a 1
.nr b 2 \}
linux> troff -v gt2
GNU troff version 1.15
gt2:4: warning: `\}' where number expected
linux> cat gt3
.if 1 \{\
.nr a 1 \}
linux> troff -v gt3
GNU troff version 1.15
gt3:3: warning: `\}' where number expected
linux> cat gt4
.if 1 \{\
.nr a 1 1 \}
linux> troff -v gt4
GNU troff version 1.15
linux> cat gt5
.if 1 \{\
.nr a 1
.na \}
linux> troff -v gt5
GNU troff version 1.15
linux> cat gt6
.if 1 \{\
.nr a 1
linux> troff -v gt6
GNU troff version 1.15
x T ps
x res 72000 1 1
x init
n12000 0
x trailer
x stop
linux> ^D

Script done on Sun Dec 10 08:20:31 2000

reply via email to

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