When parsing subs with user-defined prototypes, store information needed to throw...
authorMatthew Horsfall (alh) <wolfsage@gmail.com>
Tue, 23 Aug 2011 03:32:10 +0000 (23:32 -0400)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 24 Nov 2011 16:14:14 +0000 (08:14 -0800)
toke.c

diff --git a/toke.c b/toke.c
index 7b5c465..c9206a5 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -285,6 +285,10 @@ static const char* const lex_state_names[] = {
        }
 #define UNI(f)    UNI2(f,XTERM)
 #define UNIDOR(f) UNI2(f,XTERMORDORDOR)
+#define UNIPROTO(f) { \
+       PL_last_uni = PL_oldbufptr; \
+       OPERATOR(f); \
+       }
 
 #define UNIBRACK(f) { \
        pl_yylval.ival = f; \
@@ -6863,12 +6867,12 @@ Perl_yylex(pTHX)
                             *proto == '\\' && proto[1] && proto[2] == '\0'
                            )
                        )
-                           OPERATOR(UNIOPSUB);
+                           UNIPROTO(UNIOPSUB);
                        if (*proto == '\\' && proto[1] == '[') {
                            const char *p = proto + 2;
                            while(*p && *p != ']')
                                ++p;
-                           if(*p == ']' && !p[1]) OPERATOR(UNIOPSUB);
+                           if(*p == ']' && !p[1]) UNIPROTO(UNIOPSUB);
                        }
                        if (*proto == '&' && *s == '{') {
                            if (PL_curstash)