Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] Deparse, ''->(), ::(), sub :: {}, etc. #8903

Closed
p5pRT opened this issue May 21, 2007 · 8 comments
Closed

[PATCH] Deparse, ''->(), ::(), sub :: {}, etc. #8903

p5pRT opened this issue May 21, 2007 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented May 21, 2007

Migrated from rt.perl.org#43010 (status was 'resolved')

Searchable as RT43010$

@p5pRT
Copy link
Author

p5pRT commented May 21, 2007

From @cpansprout

I found the following problem with B​::Deparse​:

$ perl5.9.5 -MO=Deparse -e '"my %h = "->()'
my %h = ();
-e syntax OK

In trying to fix it I found more problems​:

$ perl5.9.5 -MO=Deparse -e '​::->()'
main​::();
-e syntax OK

(main​::() is a syntax error.)

$ perl5.9.5 -MO=Deparse -e 'sub :​: {}'
-e syntax OK

Where did that sub go?

$ perl5.9.5 -MO=Deparse -e 'package a; sub a​::b​::c {}'
package a;
sub b​::c {

}
-e syntax OK
$ perl5.9.5 -MO=Deparse -e 'sub the​::main​::road {}'
-e syntax OK

The attached patch (which I believe will work for 5.8.8 as well as
5.9.5) fixes these, except there is one problem still left​:

$ perl5.9.5 -MO=Deparse -e 'sub :​::​::​: {}'
-e syntax OK

Let's just hope no-one names a subroutine '​::​::​::'. :-) Also, I'm not
sure how to add tests for 'sub main​:: {}', 'package a; sub a​::b​::c
{}' and 'sub the​::main​::road {}' to deparse.t.

I hope this is helpful.

use B​::Deparse; *{'0&&'} = sub { 1 };
&{eval 'sub'.coderef2text{new B​::Deparse}sub{print+(
'Just another Perl hacker,','Deparse has been fixed!'
)['0&&'->()],"\n"}}


Flags​:
  category=library
  severity=medium


Site configuration information for perl 5.9.5​:

Configured by neo at Tue May 15 14​:11​:42 PDT 2007.

Summary of my perl5 (revision 5 version 9 subversion 5 patch 31224)
configuration​:
  Platform​:
  osname=darwin, osvers=8.8.0, archname=darwin-2level
  uname='darwin treebeard.local 8.8.0 darwin kernel version 8.8.0​:
fri sep 8 17​:18​:57 pdt 2006; root​:xnu-792.12.6.obj~1release_ppc power
macintosh powerpc '
  config_args='-de -Dusedevel'
  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 -I/usr/local/include',
  optimize='-O3',
  cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-
precomp -fno-strict-aliasing -pipe -I/usr/local/include'
  ccversion='', gccversion='4.0.0 20041026 (Apple Computer, Inc.
build 4061)', gccosandvers='darwin8'
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
  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.3 cc', ldflags =' -L/usr/
local/lib'
  libpth=/usr/local/lib /usr/lib
  libs=-ldbm -ldl -lm -lc
  perllibs=-ldl -lm -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 -L/
usr/local/lib'

Locally applied patches​:
  DEVEL


@​INC for perl 5.9.5​:
  /usr/local/lib/perl5/5.9.5/darwin-2level
  /usr/local/lib/perl5/5.9.5
  /usr/local/lib/perl5/site_perl/5.9.5/darwin-2level
  /usr/local/lib/perl5/site_perl/5.9.5
  /usr/local/lib/perl5/site_perl
  .


Environment for perl 5.9.5​:
  DYLD_LIBRARY_PATH (unset)
  HOME=/Users/neo
  LANG (unset)
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/bin​:/sbin​:/usr/bin​:/usr/sbin​:/usr/TeX/bin/powerpc-
darwin6.8​:/usr/local/bin
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented May 21, 2007

From @cpansprout

I forgot to attach the patch. Does everyone else make this mistake?

@p5pRT
Copy link
Author

p5pRT commented May 21, 2007

From @cpansprout

Deparse.pm.diff

@p5pRT
Copy link
Author

p5pRT commented May 21, 2007

From @cpansprout

deparse.t.diff

@p5pRT
Copy link
Author

p5pRT commented May 21, 2007

From nospam-abuse@bloodgate.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash​: SHA1

Moin,

On Monday 21 May 2007 05​:08​:42 Father Chrysostomos wrote​:

I forgot to attach the patch. Does everyone else make this mistake?

Not me anymore since I use KMail with kindly reminds me that if I
write "attach" or similiar, I should actually attach something :)

all the best,

Tels

- --
Signed on Mon May 21 16​:37​:51 2007 with key 0x93B84C15.
View my photo gallery​: http​://bloodgate.com/photos
PGP key on http​://bloodgate.com/tels.asc or per email.

"Not King yet."

-----BEGIN PGP SIGNATURE-----
Version​: GnuPG v1.4.2 (GNU/Linux)

iQEVAwUBRlHLC3cLPEOTuEwVAQK/Jgf+JOIkVbLtk4qbeKbUPA7QwggivfqQGZlF
l+S4WNYSoyxB8STq7Tj9gxGOYoVaYVkBhkB6TPzpFPLbO8cR2oYnPayI3q8/2idS
6cUVXBBHf3AGJ7dQSdw2qqx9epr0OKGFBw9PUpf9zkSvuDnooZpixPChhz40tU/H
BbVX0xyxqoWYEPw4z/EqXonTracTpzupvti4U3SKIgcde6Bt/Hi5cLKYYMj+2ELp
tav6kQD9nd6+1sZltqbPxURLnSVBRuKZpw+AbdexUIzENh4Qs7mxd6V2XyAyYrHc
pZZPoFIsRJDul22aQjnl1zAvkvzI32xacAQkkvFJTtdDPsrlOi8YBw==
=N0PB
-----END PGP SIGNATURE-----

@p5pRT
Copy link
Author

p5pRT commented May 21, 2007

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 24, 2007

@rgs - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed May 24, 2007
@p5pRT
Copy link
Author

p5pRT commented May 24, 2007

From @rgs

On 21/05/07, Father Chrysostomos <sprout@​cpan.org> wrote​:

I forgot to attach the patch. Does everyone else make this mistake?

Thanks, applied as #31268.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant