Skip Menu |
 
Report information
Id: 57980
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: jesse [at] perl.org
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Fix bugs with nested ?? !!
Date: Sat, 16 Aug 2008 10:28:44 -0400 (EDT)
To: rakudobug [...] perl.org
From: jesse [...] perl.org
- Awaiting parser improvements (PGE)
Download (untitled) / with headers
text/plain 174b
On Sat Aug 16 07:29:36 2008, jesse@perl.org wrote: Show quoted text
> - Awaiting parser improvements (PGE)
A simple, failing test: say True ?? 1 !! False ?? 2 !! 3; (says 2, should say 1)
Attached is a very simple patch that solves the problem, but I've only tested lightly.
Download ternary.patch
text/plain 539b
Index: languages/perl6/src/parser/grammar-oper.pg =================================================================== --- languages/perl6/src/parser/grammar-oper.pg (revision 32593) +++ languages/perl6/src/parser/grammar-oper.pg (working copy) @@ -135,7 +135,7 @@ { ... } ## conditional -proto ternary:<?? !!> is precedence('j=') is pasttype('if') { ... } +proto ternary:<?? !!> is precedence('j=') is pasttype('if') is assoc('right') { ... } ## item assignment proto infix:<:=> is precedence('i=') is pasttype('bind') { ... }
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 269b
On Wed Nov 12 23:00:38 2008, chrisdolan wrote: Show quoted text
> Attached is a very simple patch that solves the problem, but I've only > tested lightly.
I am truly impressed -- this particular approach to solving the problem never occurred to me. Patch applied (r32618), thanks! Pm


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org