This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
added patch, regen headers
authorIlya Zakharevich <ilya@math.berkeley.edu>
Thu, 18 Jun 1998 22:27:31 +0000 (18:27 -0400)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 21 Jun 1998 00:10:18 +0000 (00:10 +0000)
Message-Id: <199806190227.WAA07371@monk.mps.ohio-state.edu>
Subject: Re: Ilya's patches

p4raw-id: //depot/perl@1169

ObjXSub.h
embedvar.h
interp.sym
intrpvar.h
toke.c

index c2ef658..e1a266e 100644 (file)
--- a/ObjXSub.h
+++ b/ObjXSub.h
 #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
index 2e64829..ca1e065 100644 (file)
 #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)
 #define Iincgv                 incgv
 #define Iinitav                        initav
 #define Iinplace               inplace
+#define Ilast_proto            last_proto
 #define Ilastfd                        lastfd
 #define Ilastgotoprobe         lastgotoprobe
 #define Ilastscream            lastscream
 #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
index 7bbb11e..924b048 100644 (file)
@@ -68,6 +68,7 @@ initav
 inplace
 sys_intern
 last_in_gv
+last_proto
 lastfd
 lastgotoprobe
 lastscream
index 74c914b..5637f12 100644 (file)
@@ -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)            
diff --git a/toke.c b/toke.c
index c035563..f8b31bd 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -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);