%nonassoc PREC_LOW
%nonassoc LOOPEX
-%left <ival> OROP
+%left <ival> OROP DOROP
%left ANDOP
%right NOTOP
%nonassoc LSTOP LSTOPSUB
%right <ival> ASSIGNOP
%right '?' ':'
%nonassoc DOTDOT
-%left OROR
+%left OROR DORDOR
%left ANDAND
%left <ival> BITOROP
%left <ival> BITANDOP
package : PACKAGE WORD ';'
{ package($2); }
- | PACKAGE ';'
- { package(Nullop); }
;
use : USE startsub
{ $$ = 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
;
subscripted: star '{' expr ';' '}' /* *main::{something} */
/* In this and all the hash accessors, ';' is
* provided by the tokeniser */
- { $$ = newBINOP(OP_GELEM, 0, $1, scalar($3)); }
+ { $$ = newBINOP(OP_GELEM, 0, $1, scalar($3));
+ PL_expect = XOPERATOR; }
| scalar '[' expr ']' /* $array[$element] */
{ $$ = newBINOP(OP_AELEM, 0, oopsAV($1), scalar($3)); }
| term ARROW '[' expr ']' /* somearef->[$element] */
{ $$ = 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); }
;