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

Parse fails due to user-friendlyness on ?? : !! #3785

Closed
p6rt opened this issue Apr 17, 2015 · 4 comments
Closed

Parse fails due to user-friendlyness on ?? : !! #3785

p6rt opened this issue Apr 17, 2015 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Apr 17, 2015

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

Searchable as RT124323$

@p6rt
Copy link
Author

p6rt commented Apr 17, 2015

From hmbrand@xs4all.nl

$ perl6 -e'my@​x=^10;my@​y=2..3;my@​z=@​y??@​x[@​y]​:v!!@​x'
===SORRY!=== Error while compiling -e
Please use !! rather than :
at -e​:1
------> my@​x=^10;my@​y=2..3;my@​z=@​y??@​x[@​y]​:v⏏!!@​x
  expecting any of​:
  pair value

The :v triggers the parse error trying to be helpful even though the !!
is correctly used

@p6rt
Copy link
Author

p6rt commented Apr 17, 2015

From @usev6

This was fixed promptly. The code now dies with the right exception.

$ perl6 -e'my@​x=^10;my@​y=2..3;my@​z=@​y??@​x[@​y]​:v!!@​x'
===SORRY!=== Error while compiling -e
Precedence of :v is too loose to use inside ?? !!; please parenthesize
at -e​:1
------> my@​x=^10;my@​y=2..3;my@​z=@​y??@​x[@​y]​:v⏏!!@​x
  expecting any of​:
  pair value

Using parentheses as suggested works​:

$ perl6 -e'my@​x=^10;my@​y=2..3;my@​z=@​y??(@​x[@​y]​:v)!!@​x;@​z.say'
2 3

I added two tests to S03-operators/ternary.t with commit Raku/roast@1790997c8c

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Apr 17, 2015

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

@p6rt
Copy link
Author

p6rt commented Apr 17, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant