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

named @-siggiled capture explodes when it aliases a positional capture #3318

Closed
p6rt opened this issue Jan 22, 2014 · 4 comments
Closed

named @-siggiled capture explodes when it aliases a positional capture #3318

p6rt opened this issue Jan 22, 2014 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Jan 22, 2014

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

Searchable as RT121061$

@p6rt
Copy link
Author

p6rt commented Jan 22, 2014

From @FROGGS

This should return a list with one element "a"​:
<FROGGS> r​: say "a" ~~ /@​<from>=(.)*/
<camelia> rakudo-jvm 334033​: OUTPUT«===SORRY!===␤setcodeobj can only be used with a CodeRef␤»
<camelia> ..rakudo-moar 334033​: OUTPUT«===SORRY!===␤Error while compiling op bind​: QAST​::Block with cuid cuid_1_1390422748.111026 has not appeared␤»
<camelia> ..rakudo-parrot 334033​: OUTPUT«===SORRY!===␤Could not find sub cuid_1_1390422746.49692␤»

# This clearly does the right thing​:
<FROGGS> r​: say "a" ~~ /$<from>=(.)*/
<camelia> rakudo-parrot 334033, rakudo-jvm 334033, rakudo-moar 334033​: OUTPUT«「a」␤ from => 「a」␤␤»

# The explosion is not about the quantifier​:
<FROGGS> r​: say "a" ~~ /@​<from>=(.)+/
<camelia> rakudo-jvm 334033​: OUTPUT«===SORRY!===␤setcodeobj can only be used with a CodeRef␤»
<camelia> ..rakudo-parrot 334033​: OUTPUT«===SORRY!===␤Could not find sub cuid_1_1390422776.05268␤»
<camelia> ..rakudo-moar 334033​: OUTPUT«===SORRY!===␤Error while compiling op bind​: QAST​::Block with cuid cuid_1_1390422777.778583 has not appeared␤»

# It seems to be about positional captures​:
<FROGGS> r​: say "a" ~~ /@​<from>=[.]+/
<camelia> rakudo-parrot 334033, rakudo-jvm 334033, rakudo-moar 334033​: OUTPUT«Nil␤»

The last example does not explode, but unfortunately returns Nil when it should return our nice little "a".

@p6rt
Copy link
Author

p6rt commented Nov 11, 2015

From @usev6

All these examples work now​:

$ perl6 -e 'say "a" ~~ /@​<from>=(.)*/'
「a」
from => 「a」

$ perl6 -e 'say "a" ~~ /$<from>=(.)*/'
「a」
from => 「a」

$ perl6 -e 'say "a" ~~ /@​<from>=(.)+/'
「a」
from => 「a」

$ perl6 -e 'say "a" ~~ /@​<from>=[.]+/'
「a」
from => 「a」

I added tests for the previously failing evaluations to S05-capture/array-alias.t (commit Raku/roast@cd2f27032f).

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 11, 2015

From @usev6

All these examples work now​:

$ perl6 -e 'say "a" ~~ /@​<from>=(.)*/'
「a」
from => 「a」

$ perl6 -e 'say "a" ~~ /$<from>=(.)*/'
「a」
from => 「a」

$ perl6 -e 'say "a" ~~ /@​<from>=(.)+/'
「a」
from => 「a」

$ perl6 -e 'say "a" ~~ /@​<from>=[.]+/'
「a」
from => 「a」

I added tests for the previously failing evaluations to S05-capture/array-alias.t (commit Raku/roast@cd2f27032f).

I'm closing this ticket as 'resolved'.

@p6rt p6rt closed this as completed Nov 11, 2015
@p6rt
Copy link
Author

p6rt commented Nov 11, 2015

@usev6 - Status changed from 'new' 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