develooper Front page | perl.perl5.porters | Postings from December 2000

Re: [ID 20001230.005] Documentation error in perlsyn (and PP3ed) re: #line directives

Thread Previous
From:
Jarkko Hietaniemi
Date:
December 31, 2000 10:00
Subject:
Re: [ID 20001230.005] Documentation error in perlsyn (and PP3ed) re: #line directives
Message ID:
20001231115940.C4964@chaos.wustl.edu
On Sat, Dec 30, 2000 at 06:33:54PM -0500, clintp@geeksalad.org wrote:
> This is a bug report for perl from clintp@budman.backroom,
> generated with the help of perlbug 1.26 running under perl 5.006.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> The perlsyn documenation declares that:
> 
>        Much like the C preprocessor, Perl can process line
>        directives.  Using this, one can control Perl's idea of
>        filenames and line numbers in error or warning messages
>        (especially for strings that are processed with eval()).
>        The syntax for this mechanism is the same as for most C
>        preprocessors: it matches the regular expression
>        /^#\s*line\s+(\d+)\s*(?:\s"([^"]+)")?\s*$/ with $1 being
>        the line number for the next line, and $2 being the
>        optional filename (specified within quotes).
> 
> The regular expression there is just plain wrong. According to 
> toke.c, perl doesn't care about quotes much (except they get
> placed into __FILE__ if they're there) and \s isn't quite 
> acurate either (' ' and \t are what's looked for).
> 
> Programming Perl (3ed) in Chap 24, "Generating Perl in Other
> Languages" repeats the error.

Do you have a suggestion for a correct regex/wording?

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About