diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1998-06-18 18:27:31 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-06-21 00:10:18 +0000 |
commit | 2a841d1398ee9bbf30a942905192cc2591b3e92a (patch) | |
tree | ff2c559e5659a94c9783d486c766217cb43b0d92 | |
parent | fbb426e4e4fa9111602f64c566d240fa509dea6f (diff) | |
download | perl-2a841d1398ee9bbf30a942905192cc2591b3e92a.tar.gz |
added patch, regen headers
Message-Id: <199806190227.WAA07371@monk.mps.ohio-state.edu>
Subject: Re: Ilya's patches
p4raw-id: //depot/perl@1169
-rw-r--r-- | ObjXSub.h | 2 | ||||
-rw-r--r-- | embedvar.h | 3 | ||||
-rw-r--r-- | interp.sym | 1 | ||||
-rw-r--r-- | intrpvar.h | 1 | ||||
-rw-r--r-- | toke.c | 16 |
5 files changed, 17 insertions, 6 deletions
@@ -234,6 +234,8 @@ #define inplace pPerl->Perl_inplace #undef last_in_gv #define last_in_gv pPerl->Perl_last_in_gv +#undef last_proto +#define last_proto pPerl->Perl_last_proto #undef last_lop #define last_lop pPerl->Perl_last_lop #undef last_lop_op diff --git a/embedvar.h b/embedvar.h index 2e64829b6c..ca1e065ea8 100644 --- a/embedvar.h +++ b/embedvar.h @@ -136,6 +136,7 @@ #define incgv (curinterp->Iincgv) #define initav (curinterp->Iinitav) #define inplace (curinterp->Iinplace) +#define last_proto (curinterp->Ilast_proto) #define lastfd (curinterp->Ilastfd) #define lastgotoprobe (curinterp->Ilastgotoprobe) #define lastscream (curinterp->Ilastscream) @@ -300,6 +301,7 @@ #define Iincgv incgv #define Iinitav initav #define Iinplace inplace +#define Ilast_proto last_proto #define Ilastfd lastfd #define Ilastgotoprobe lastgotoprobe #define Ilastscream lastscream @@ -526,6 +528,7 @@ #define incgv Perl_incgv #define initav Perl_initav #define inplace Perl_inplace +#define last_proto Perl_last_proto #define lastfd Perl_lastfd #define lastgotoprobe Perl_lastgotoprobe #define lastscream Perl_lastscream diff --git a/interp.sym b/interp.sym index 7bbb11e5fc..924b048e5b 100644 --- a/interp.sym +++ b/interp.sym @@ -68,6 +68,7 @@ initav inplace sys_intern last_in_gv +last_proto lastfd lastgotoprobe lastscream diff --git a/intrpvar.h b/intrpvar.h index 74c914bb29..5637f126be 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -109,6 +109,7 @@ PERLVAR(Ifdpid, AV *) /* keep fd-to-pid mappings for my_popen */ /* internal state */ PERLVAR(Itainting, bool) /* doing taint checks */ PERLVARI(Iop_mask, char *, NULL) /* masked operations for safe evals */ +PERLVAR(Ilast_proto, char *) /* Prototype of last sub seen. */ /* trace state */ PERLVAR(Idlevel, I32) @@ -2893,8 +2893,11 @@ yylex(void) oldoldbufptr < bufptr && (oldoldbufptr == last_lop || oldoldbufptr == last_uni) && /* NO SKIPSPACE BEFORE HERE! */ - (expect == XREF || - ((opargs[last_lop_op] >> OASHIFT)& 7) == OA_FILEREF) ) + (expect == XREF + || ((opargs[last_lop_op] >> OASHIFT)& 7) == OA_FILEREF + || (last_lop_op == OP_ENTERSUB + && last_proto + && last_proto[last_proto[0] == ';' ? 1 : 0] == '*')) ) { bool immediate_paren = *s == '('; @@ -2975,16 +2978,17 @@ yylex(void) /* Is there a prototype? */ if (SvPOK(cv)) { STRLEN len; - char *proto = SvPV((SV*)cv, len); + last_proto = SvPV((SV*)cv, len); if (!len) TERM(FUNC0SUB); - if (strEQ(proto, "$")) + if (strEQ(last_proto, "$")) OPERATOR(UNIOPSUB); - if (*proto == '&' && *s == '{') { + if (*last_proto == '&' && *s == '{') { sv_setpv(subname,"__ANON__"); PREBLOCK(LSTOPSUB); } - } + } else + last_proto = NULL; nextval[nexttoke].opval = yylval.opval; expect = XTERM; force_next(WORD); |