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

「take」 inside global and exhaustive matching is broken (m:g/. {take 1}/) #5166

Closed
p6rt opened this issue Mar 7, 2016 · 5 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Mar 7, 2016

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

Searchable as RT127672$

@p6rt
Copy link
Author

p6rt commented Mar 7, 2016

From @AlexDaniel

Code​:
say gather â��abcâ�� ~~ m​:g/ . {take â��Xâ��} /

Result​:
(X)

I expected to get three X-s, but I only got the first one (like if it lost :g).

However, if you just ï½¢sayï½£ it, then you get the right result​:
â��abcâ�� ~~ m​:g/ . {say â��Xâ��} /

Result​:
X
X
X

Same problem with exhaustive​:
say gather â��abcâ�� ~~ m​:ex/ .+? {take â��Xâ��} /

Result​:
(X)

Interestingly, backtracking works as expected​:
say gather �bc� ~~ m/(.)* {take �X�} �c� /

Result​:
(X X)

@p6rt
Copy link
Author

p6rt commented Jul 10, 2016

From @zoffixznet

Still present in today's rakudo de5d9e​:

<Zoffix> m​: say gather â��abcâ�� ~~ m​:g/ . {take â��Xâ��} /
<camelia> rakudo-moar de5d9e​: OUTPUT«(X)â�¤Â»

@p6rt
Copy link
Author

p6rt commented Feb 10, 2017

From @zoffixznet

Fixed by rakudo/rakudo@b7201a8

Tests needed.

@p6rt
Copy link
Author

p6rt commented Oct 6, 2017

From @moritz

Test added​: Raku/roast@7fd6b6f3ac

@p6rt
Copy link
Author

p6rt commented Oct 6, 2017

@zoffixznet - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Oct 6, 2017
@p6rt p6rt added the testneeded label Jan 5, 2020
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