On Mon, 20 Aug 2001 14:35:13 -0400, in perl.perl5.porters you wrote:

> On Mon, Aug 20, 2001 at 10:53:15AM -0600, Sean M. Burke wrote:
> > At 11:00 AM 2001-08-20 -0400, Ronald J Kimball wrote:
> > >I agree with Philip, that paragraph-based parsing should *not* be removed.
> > >The problem of non-empty blank lines is not a reason remove paragraph-based
> > >parsing; just declare non-empty blank lines to be the same as empty blank
> > >lines.
> > 
> > First off, when did Philip (Newton?) say that [this kind of]
> > paragraph-based parsing should be removed?  I'd like to see his arguments.
> > (I do see his message that asks "Does that mean that the following will be
> > misparsed?[...]" but that was just a question (answered: "no").)
> 
> Err...  I thought he had said that it should not be removed.  Apologies if
> I'm mistaken.

What I was concerned about was that lines in formatted paragraphs (i.e. those
that are flush-left rather than verbatim paragraphs which start with spaces) be
interpreted as pod commands if they start with an equals sign. Which is related
to paragraph-based parsing, so I would like it to say.

Sean responded that

    The way to make an indented, bulleted list in POD is to use
    =over with a number, then any number of =item s, followed by
    =back to finish off the list.

(an example I gave) would not be misparsed, but

  The way to stop a POD block and tell perl to start parsing is a
  =cut command.  Just make sure it's at the start of the line,
  and everything'll work right.

(his example) would, and gave as an explanation that

: that's the way perl works currently (if I understand toke.c): a line
: matching m/^\w/ means go into pod mode, and subsequent m/^=cut/ line
: means go out of pod mode.  I'm merely mandating that pod parsers agree
: with perl on this.

And I'm still concerned about this, because it sort-of means that pod parsers
have to understand Perl.

> > So that I can make sure that we're talking about the same thing:  What I
> > think we're arguing here is just whether or a =foo that starts a pod
> > section has to be preceded by a blank/empty line, and also whether a =cut
> > that ends a pod section has to be followed by a blank/empty line.
> > Correct me if you have something else in mind.
> 
> I think pod commands in general should be preceeded by a blank line and
> followed by a blank line.  But especially a pod command that starts a pod
> section should be preceeded by a blank line, in perl and pod parsers.

I agree with you. I also think that a pod command that *ends* a pod section
should be preceeded by a blank line, in perl and pod parsers. So that just
having =cut at the beginning of a line should *not* trigger end-of-pod-parsing,
not even in pod which is embedded in a Perl source file and is being
parsed/ignored by perl itself, since IMO it would be too dangerous.

One argument I brought forth was automatic paragraph-wrapping. If someone has a
formatted paragraph of pod text which happens to contain =cut in the middle, and
then goes on and adds some stuff to the paragraph, resulting in a big long line,
and then runs it through fmt or otherwise re-formats the paragraph in his
editor, I don't want to force the author to check the paragraph to see whether
this didn't accidentally move the =cut to the beginning of the line, resulting
in misinterpretation.

Cheers,
Philip
-- 
Philip Newton <[EMAIL PROTECTED]>
Email copies of replies to my messages to perl5 lists are welcome

Reply via email to