Re: [perl #24574] find2perl provides different results to find
[p5sagit/p5-mst-13.2.git] / perly.y
diff --git a/perly.y b/perly.y
index f87f581..7d39242 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -96,7 +96,7 @@ static void yydestruct(pTHX_ void *ptr);
 %nonassoc PREC_LOW
 %nonassoc LOOPEX
 
-%left <ival> OROP
+%left <ival> OROP DOROP
 %left ANDOP
 %right NOTOP
 %nonassoc LSTOP LSTOPSUB
@@ -104,7 +104,7 @@ static void yydestruct(pTHX_ void *ptr);
 %right <ival> ASSIGNOP
 %right '?' ':'
 %nonassoc DOTDOT
-%left OROR
+%left OROR DORDOR
 %left ANDAND
 %left <ival> BITOROP
 %left <ival> BITANDOP
@@ -404,8 +404,6 @@ subbody     :       block   { $$ = $1; }
 
 package :      PACKAGE WORD ';'
                        { package($2); }
-       |       PACKAGE ';'
-                       { package(Nullop); }
        ;
 
 use    :       USE startsub
@@ -419,6 +417,8 @@ expr        :       expr ANDOP expr
                        { $$ = newLOGOP(OP_AND, 0, $1, $3); }
        |       expr OROP expr
                        { $$ = newLOGOP($2, 0, $1, $3); }
+       |       expr DOROP expr
+                       { $$ = newLOGOP(OP_DOR, 0, $1, $3); }
        |       argexpr %prec PREC_LOW
        ;
 
@@ -545,6 +545,8 @@ termbinop   :       term ASSIGNOP term             /* $x = $y */
                        { $$ = newLOGOP(OP_AND, 0, $1, $3); }
        |       term OROR term                         /* $x || $y */
                        { $$ = newLOGOP(OP_OR, 0, $1, $3); }
+       |       term DORDOR term                       /* $x // $y */
+                       { $$ = newLOGOP(OP_DOR, 0, $1, $3); }
        |       term MATCHOP term                      /* $x =~ /$y/ */
                        { $$ = bind_match($2, $1, $3); }
     ;