[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[perl #59170] Typo: bad regex for #line directive in perlsyn.



# New Ticket Created by  Elliot Shank 
# Please include the string:  [perl #59170]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=59170 >


This is a bug report for perl from perl@galumph.com,
generated with the help of perlbug 1.36 running under perl 5.10.0.

The documentation for the #line directive in perlsyn gives a regular expression for valid syntax.  This regex says that whitespace is required between the line number and the filename.  Empirical evidence says otherwise.  For example:

    use 5.010;
    #line 25foo
    say __LINE__, q< >, __FILE__;

does emit "25 foo".  Patch attached.
---
Flags:
    category=docs
    severity=low
---
Site configuration information for perl 5.10.0:

Configured by elliot at Thu Jan 17 21:18:20 CST 2008.

Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  Platform:
    osname=darwin, osvers=9.1.0, archname=darwin-2level
    uname='darwin quaquaversal.local 9.1.0 darwin kernel version 9.1.0: wed oct 31 17:46:22 pdt 2007; root:xnu-1228.0.2~1release_i386 i386 '
    config_args='-Dprefix=/Users/elliot/opt/perl/perl-5.10'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe',
    optimize='-O3',
    cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe'
    ccversion='', gccversion='4.0.1 (Apple Inc. build 5465)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='env MACOSX_DEPLOYMENT_TARGET=10.5 cc', ldflags =''
    libpth=/usr/lib
    libs=-ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup'

Locally applied patches:
    

---
@INC for perl 5.10.0:
    /Users/elliot/opt/perl/perl-5.10/lib/5.10.0/darwin-2level
    /Users/elliot/opt/perl/perl-5.10/lib/5.10.0
    /Users/elliot/opt/perl/perl-5.10/lib/site_perl/5.10.0/darwin-2level
    /Users/elliot/opt/perl/perl-5.10/lib/site_perl/5.10.0
    .

---
Environment for perl 5.10.0:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/elliot
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/Users/elliot/bin:/Users/elliot/opt/bin:/Users/elliot/opt/perl/perl-5.10/bin:/opt/local/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/X11/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash
--- perlsyn.pod	2008-01-17 21:34:15.000000000 -0600
+++ perlsyn.pod.new	2008-09-21 16:09:44.000000000 -0500
@@ -835,7 +835,7 @@
     # example: '# line 42 "new_filename.plx"'
     /^\#   \s*
       line \s+ (\d+)   \s*
-      (?:\s("?)([^"]+)\2)? \s*
+      (?:("?)([^"]+)\2)? \s*
      $/x
 
 with C<$1> being the line number for the next line, and C<$3> being

Follow-Ups from:
"Rafael Garcia-Suarez" <rgarciasuarez@gmail.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]