[Top][All Lists]

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

Re: [Groff] What does the "-u" in ".tmac-u" mean?

From: G. Branden Robinson
Subject: Re: [Groff] What does the "-u" in ".tmac-u" mean?
Date: Sun, 5 Nov 2017 06:32:13 -0500
User-agent: NeoMutt/20170113 (1.7.2)

At 2017-11-05T11:42:48+0100, Ulrich Lauther wrote:
> > > Werner wrote:
> > > > Branden wrote:
> > > > > I move that we stop stripping the files.  Stripping them is
> > > > > saving us only a few hundred kB out of 25 megs.
> > > > It's not about saving disk space.  Remember that groff is an
> > > > interpreted language *without* a translation to an internal
> > > > representation.[*]  This means, for example, that a comment
> > > > within a loop with 1000 repeats gets parsed a thousand times,
> > > > again and again.
> Couldn't this be avoided, if groff used in a preprocess one or two sed
> commands to get rid of comments and indentation?

In theory, that's impossible (in full generality) because roff is not a
regular language.  Consider the following example:

$ cat >ec.roff
.ec #
.#" This is a roff comment after I cleverly change the escape character.
Foo#[bu]bar; a bullet separates the foo from the bar.
$ nroff ec.roff |head -n1
Foo·bar; a bullet separates the foo from the bar.

sed isn't capable of coping with such tricks.

Lest anyone think that no macro package would be that perverse, our mm
and trace macro packages _do_ redefine the escape character.

Other folks here can probably think of further examples which render a
regex substitution approach infeasible.


Attachment: signature.asc
Description: PGP signature

reply via email to

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