texinfo-devel
[Top][All Lists]
Advanced

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

Re: @-command for # in verbatim protection


From: Patrice Dumas
Subject: Re: @-command for # in verbatim protection
Date: Thu, 9 Feb 2012 01:10:21 +0100
User-agent: Mutt/1.4.2.2i

On Tue, Feb 07, 2012 at 03:31:02PM -0800, Karl Berry wrote:
>     It is a real world case, in the perl document cpp directive lines 
>     appear in a @verbatim environment.
> 
> How about using @example?

In the pod it is meant to be verbatim, however, since there is no environment
like @example and the like, I can use @format instead (as indentation is
already provided).  Still @verbatim would have been more natural, and
more practical given all the {} in perl.

> Or, more generally, since the Texinfo is being generated, it seems like
> it should be possible to devise something that will make the #line not
> be recognized and yet have no effect on the output.  For instance, how
> about adding a DEL to the end of it?

You mean to the end of the previous line?  It will eat the end of line.

>     My opinion is that there should be an @-command that can complement
> 
> But doesn't that defeat the purpose?  It means you have to parse and
> understand the entire document before you can figure out which #-lines
> are directives.  I thought #-lines were recognized more or less
> lexically, before any tree was finalized.

No, they are recognized lexically (I guess, as I don't know exactly what
lexically means in that context) but only when new line is read from a 
file, so the tree is already being done.  So from an implementation point 
of view, in texi2any, that would work.  Now, we can consider that this 
is a bad idea to have to parse the texinfo to determine whether the line 
is to be interpreted as a cpp line or not.  Though, as @include files have 
to be followed too, that does not seem that problematic.


All that make me think that having CPP_LINE_DIRECTIVES set in the default
case is a bad idea, it should be set explicitly in my opinion.

-- 
Pat



reply via email to

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