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

Non-digit parts of a number (like the underscore _) aren't considered to be part of the number in repetition quantifiers in regexes in Rakudo (but are in STD.pm6) #3221

Closed
p6rt opened this issue Aug 29, 2013 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 29, 2013

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

Searchable as RT119513$

@p6rt
Copy link
Author

p6rt commented Aug 29, 2013

From @masak

<yoleaux> 01​:36Z <diakopter> masak​: unexpected in rakudo​: say so "a"
x 1_0 ~~ /a ** 1_0/ says False
<masak> r​: say so "a" x 1_0 ~~ /a ** 1_0/
<camelia> rakudo 9faa30​: OUTPUT«False␤»
<masak> r​: say so "a" ~~ /a ** 1_0/
<camelia> rakudo 9faa30​: OUTPUT«False␤»
<masak> r​: say so "a_0" ~~ /a ** 1_0/
<camelia> rakudo 9faa30​: OUTPUT«True␤»
<moritz> it's parsed as /[a ** 1] _0/
<masak> moritz​: yes.
<moritz> masak​: and TimToady++ already patched it in STD
<jnthn> So just needs somebody to nab the patch :)
* masak submits rakudobug
<masak> r​: say so "a" ~~ / a ** 1e0 / # what about this one?
<camelia> rakudo 9faa30​: OUTPUT«False␤»
<masak> r​: say so "ae0" ~~ / a ** 1e0 /
<camelia> rakudo 9faa30​: OUTPUT«True␤»
<moritz> masak​: I'd think it would make sense to require a word
boundary after the number that follows a **
<moritz> number of reptitions are inherently integers, so I don't see
the point of allowing floating-point numbers here
<masak> moritz​: I think I agree.

@p6rt
Copy link
Author

p6rt commented Sep 25, 2013

From @jnthn

On Thu Aug 29 02​:01​:49 2013, masak wrote​:

<yoleaux> 01​:36Z <diakopter> masak​: unexpected in rakudo​: say so "a"
x 1_0 ~~ /a ** 1_0/ says False
<masak> r​: say so "a" x 1_0 ~~ /a ** 1_0/
<camelia> rakudo 9faa30​: OUTPUT«False␤»
<masak> r​: say so "a" ~~ /a ** 1_0/
<camelia> rakudo 9faa30​: OUTPUT«False␤»
<masak> r​: say so "a_0" ~~ /a ** 1_0/
<camelia> rakudo 9faa30​: OUTPUT«True␤»
<moritz> it's parsed as /[a ** 1] _0/
<masak> moritz​: yes.
<moritz> masak​: and TimToady++ already patched it in STD
<jnthn> So just needs somebody to nab the patch :)
* masak submits rakudobug

Patched nabbed​:

say so "a" x 1_0 ~~ /a ** 1_0/
True
say so "a" ~~ /a ** 1_0/
True

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Sep 25, 2013

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

@p6rt
Copy link
Author

p6rt commented Nov 6, 2013

From @FROGGS

Test is at Raku/roast@c3bfab8996

@p6rt
Copy link
Author

p6rt commented Nov 6, 2013

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

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

No branches or pull requests

1 participant