This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Simplify s/// and tr/// parsing logic
authorFather Chrysostomos <sprout@cpan.org>
Fri, 9 Jan 2015 02:49:32 +0000 (18:49 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 9 Jan 2015 03:00:57 +0000 (19:00 -0800)
commit9b6b7be8acad62650aa5c229e89fad6706c8a0b0
tree07c815d34c2af0b830e9741bfff73d78f9fb74a9
parentcc5af3775649fc00e4d4e74d41dcad591b1fa122
Simplify s/// and tr/// parsing logic

These two operators were being translated into subst("","") and
tr("","") by the lexer.  Then pmruntime in op.c would take apart the
resulting list op.  Instead of constructing a list op only to take it
apart again, feed the replacement part to pmruntime separately.  We
can achieve this by introducing a new token ('/') that the parser rec-
ognizes as introducing a replacement.

If we had followed this approach to begin with, then bug #123542 would
never have happened.

(Actually, it seems the parser did know about the replacement part to
begin with, but it changed in perl-5.8.0-4047-g131b3ad to fix some
overloading problems.)
embed.fnc
embed.h
op.c
perly.act
perly.h
perly.tab
perly.y
proto.h
toke.c