diff options
author | Brent Dax <brentdax@cpan.org> | 2002-07-25 22:41:52 -0700 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-08-05 15:04:54 +0000 |
commit | c963b151157dab5813a32fc6004b63916ad155e8 (patch) | |
tree | e88a528a16616c2f136f31b2c37b08e237b08799 /perly.y | |
parent | d73f34fb2db5664941bbe71b34c335b0ae3b50b3 (diff) | |
download | perl-c963b151157dab5813a32fc6004b63916ad155e8.tar.gz |
Defined-or patch (cleaned up)
From: "Brent Dax" <brentdax@cpan.org>
Message-id: <000001c234a1$d1ca72c0$6501a8c0@deepblue>
p4raw-id: //depot/perl@17682
Diffstat (limited to 'perly.y')
-rw-r--r-- | perly.y | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 @@ -419,6 +419,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 +547,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); } ; |