Update parsing to allow named scalars in the proto
authorPeter Martini <PeterCMartini@GMail.com>
Sat, 8 Sep 2012 04:19:52 +0000 (00:19 -0400)
committerJesse Luehrs <doy@tozt.net>
Thu, 13 Sep 2012 00:19:48 +0000 (19:19 -0500)
perly.act
perly.y

index 270d617..e61f27e 100644 (file)
--- a/perly.act
+++ b/perly.act
@@ -710,6 +710,14 @@ case 2:
     { (yyval.opval) = (OP*)NULL; ;}
     break;
 
+  case 83:
+#line 683 "perly.y"
+    { if (scan_proto(((SVOP*)(ps[(1) - (1)].val.opval))->op_sv, TRUE))
+                             (yyval.opval) = (ps[(1) - (1)].val.opval);
+                         else
+                             (yyval.opval) = (OP *)NULL; }
+    break;
+
   case 84:
 #line 687 "perly.y"
     { (yyval.opval) = (OP*)NULL; ;}
diff --git a/perly.y b/perly.y
index 04170b3..3e91148 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -680,6 +680,10 @@ subname    :       WORD    { const char *const name = SvPV_nolen_const(((SVOP*)$1)->op_sv);
 proto  :       /* NULL */
                        { $$ = (OP*)NULL; }
        |       THING
+                       { if (scan_proto(((SVOP*)$1)->op_sv, TRUE))
+                             $$ = $1;
+                         else
+                             $$ = (OP *)NULL; }
        ;
 
 /* Optional list of subroutine attributes */