In Perl_pad_check_dup(), use sv rather than name for diagnostics.
[p5sagit/p5-mst-13.2.git] / perly.y
diff --git a/perly.y b/perly.y
index 0616692..544c2e9 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -73,6 +73,7 @@
 
 %token <opval> WORD METHOD FUNCMETH THING PMFUNC PRIVATEREF
 %token <opval> FUNC0SUB UNIOPSUB LSTOPSUB
+%token <opval> PLUGEXPR PLUGSTMT
 %token <p_tkval> LABEL
 %token <i_tkval> FORMAT SUB ANONSUB PACKAGE USE
 %token <i_tkval> WHILE UNTIL IF UNLESS ELSE ELSIF CONTINUE FOR
@@ -241,6 +242,8 @@ line        :       label cond
                              }
                          })
                        }
+       |       label PLUGSTMT
+                       { $$ = newSTATEOP(0, PVAL($1), $2); }
        ;
 
 /* An expression which may have a side-effect */
@@ -635,20 +638,18 @@ subbody   :       block   { $$ = $1; }
 
 package :      PACKAGE WORD WORD ';'
                        {
-/* Since no one seem to understand or use the MAD stuff, but Larry implies
- * it shouldn't be removed, it's just commented out, and someone who
- * understands it can come along later and fix it up.
 #ifdef MAD
-                         (yyval.opval) = package((ps[(2) - (3)].val.opval));
-                         token_getmad((ps[(1) - (3)].val.i_tkval),(yyval.opval),'o');
-                         token_getmad((ps[(3) - (3)].val.i_tkval),(yyval.opval),';');
+                         $$ = package($3);
+                         token_getmad($1,$$,'o');
+                         if ($2)
+                             package_version($2);
+                         token_getmad($4,$$,';');
 #else
-*/
                          package($3);
-                          if ($2) {
-                              package_version($2);
-                          }
+                         if ($2)
+                             package_version($2);
                          $$ = (OP*)NULL;
+#endif
                        }
        ;
 
@@ -1246,6 +1247,7 @@ term      :       termbinop
                                newSVOP(OP_CONST, 0, newSVpvs("Unimplemented")));
                          TOKEN_GETMAD($1,$$,'X');
                        }
+       |       PLUGEXPR
        ;
 
 /* "my" declarations, with optional attributes */