This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
test that version.pm does not clobber locale
[perl5.git] / perly.y
diff --git a/perly.y b/perly.y
index a8adefb..ec030b9 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -74,7 +74,7 @@
 %token <i_tkval> '{' '}' '[' ']' '-' '+' '$' '@' '%' '*' '&' ';'
 
 %token <opval> WORD METHOD FUNCMETH THING PMFUNC PRIVATEREF QWLIST
-%token <opval> FUNC0SUB UNIOPSUB LSTOPSUB
+%token <opval> FUNC0OP FUNC0SUB UNIOPSUB LSTOPSUB
 %token <opval> PLUGEXPR PLUGSTMT
 %token <p_tkval> LABEL
 %token <i_tkval> FORMAT SUB ANONSUB PACKAGE USE
@@ -294,7 +294,7 @@ barestmt:   PLUGSTMT
 #endif
                          if (CvOUTSIDE(fmtcv) && !CvUNIQUE(CvOUTSIDE(fmtcv))) {
                              SvREFCNT_inc_simple_void(fmtcv);
-                             pad_add_anon((SV*)fmtcv, OP_NULL);
+                             pad_add_anon(fmtcv, OP_NULL);
                          }
                        }
        |       SUB startsub subname proto subattrlist subbody
@@ -1232,6 +1232,13 @@ term     :       termbinop
                          TOKEN_GETMAD($2,$$,'(');
                          TOKEN_GETMAD($3,$$,')');
                        }
+       |       FUNC0OP       /* Same as above, but op created in toke.c */
+                       { $$ = $1; }
+       |       FUNC0OP '(' ')'
+                       { $$ = $1;
+                         TOKEN_GETMAD($2,$$,'(');
+                         TOKEN_GETMAD($3,$$,')');
+                       }
        |       FUNC0SUB                             /* Sub treated as nullop */
                        { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
                                scalar($1)); }