Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs with nested ?? !! #246

Closed
p6rt opened this issue Aug 16, 2008 · 7 comments
Closed

Fix bugs with nested ?? !! #246

p6rt opened this issue Aug 16, 2008 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Aug 16, 2008

Migrated from rt.perl.org#57980 (status was 'resolved')

Searchable as RT57980$

@p6rt
Copy link
Author

p6rt commented Aug 16, 2008

From @obra

- Awaiting parser improvements (PGE)

@p6rt
Copy link
Author

p6rt commented Nov 11, 2008

From @chrisdolan

On Sat Aug 16 07​:29​:36 2008, jesse@​perl.org wrote​:

- Awaiting parser improvements (PGE)

A simple, failing test​:

say True ?? 1 !! False ?? 2 !! 3;

(says 2, should say 1)

@p6rt
Copy link
Author

p6rt commented Nov 11, 2008

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Nov 13, 2008

From @chrisdolan

Attached is a very simple patch that solves the problem, but I've only
tested lightly.

@p6rt
Copy link
Author

p6rt commented Nov 13, 2008

From @chrisdolan

ternary.patch
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') { ... }

@p6rt
Copy link
Author

p6rt commented Nov 13, 2008

From @pmichaud

On Wed Nov 12 23​:00​:38 2008, chrisdolan wrote​:

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

@p6rt
Copy link
Author

p6rt commented Nov 13, 2008

@pmichaud - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Nov 13, 2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant