diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-10-17 16:07:04 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-10-17 16:07:04 +0000 |
commit | b13fd70a68ddf5966a8175e04009af31c9841332 (patch) | |
tree | 0f36f6edc1b8a9e7c973692c254ec03aee519e90 /op.c | |
parent | c36568be88bd894c59f9e2994c64120ffb2941bb (diff) | |
download | perl-b13fd70a68ddf5966a8175e04009af31c9841332.tar.gz |
First attempt at implementing the _ prototype
p4raw-id: //depot/perl@29032
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -7375,6 +7375,7 @@ Perl_ck_subr(pTHX_ OP *o) optional = 1; proto++; continue; + case '_': case '$': proto++; arg++; @@ -7533,6 +7534,12 @@ Perl_ck_subr(pTHX_ OP *o) mod(o2, OP_ENTERSUB); prev = o2; o2 = o2->op_sibling; + if (o2 && o2->op_type == OP_NULL && proto && *proto == '_') { + /* generate an access to $_ */ + o2 = newDEFSVOP(); + o2->op_sibling = prev->op_sibling; + prev->op_sibling = o2; /* instead of cvop */ + } } /* while */ if (proto && !optional && proto_end > proto && (*proto != '@' && *proto != '%' && *proto != ';')) |