You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
<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.
<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
Migrated from rt.perl.org#119513 (status was 'resolved')
Searchable as RT119513$
The text was updated successfully, but these errors were encountered: