Skip Menu |
Report information
Id: 131247
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [REGRESSION] )> in regex results in stuff being matched wrongly ( /)> . <(/ )
Download (untitled) / with headers
text/plain 465b
Code: say "abc" ~~ /)> . <(/ Result (2015.12 … 2017.03): #<failed match> Result (2017.04.3, HEAD(701dab3)) 「bc」 「bc」 is definitely wrong and #<failed match> is kinda right. Bisectable points to these two commits: * https://github.com/rakudo/rakudo/commit/5d68f1ff1a8b32570a686bb8151805ba60d98251 * https://github.com/rakudo/rakudo/commit/3cff74cf5ac40e9df4ca45764759d84cc43a0c67 IRC log: https://irclog.perlgeek.de/perl6-dev/2017-05-02#i_14521403
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 655b
On Tue, 02 May 2017 14:51:47 -0700, alex.jakimenko@gmail.com wrote: Show quoted text
> Code: > say "abc" ~~ /)> . <(/ > > > Result (2015.12 … 2017.03): > #<failed match> > > > Result (2017.04.3, HEAD(701dab3)) > 「bc」 > > > > 「bc」 is definitely wrong and #<failed match> is kinda right. > > Bisectable points to these two commits: > * > https://github.com/rakudo/rakudo/commit/5d68f1ff1a8b32570a686bb8151805ba60d98251 > * > https://github.com/rakudo/rakudo/commit/3cff74cf5ac40e9df4ca45764759d84cc43a0c67 > > IRC log: https://irclog.perlgeek.de/perl6-dev/2017-05-02#i_14521403
Given it can never match, a compile-time error might be the best solution.
Download (untitled) / with headers
text/plain 358b
Another case that might benefit from being complained about with an error. Only the last capture is used: <Zoffix__> star: use Test; is-deeply ~('123456789foobarMEOWS'~~ /<(fo)> o <( ba)> r/), 'foba', 'case 3'; <camelia> star-m 2016.10: OUTPUT: «not ok 1 - case 3␤␤# Failed test 'case 3'␤# at <tmp> line 1␤# expected: "foba"␤# got: "ba"␤»
Download (untitled) / with headers
text/plain 497b
Just as a historical perspective, failed matches used to be Match objects where .from > .to, and iirc NQP still does it that way. When funny placement of )> and <( tricks the regex engine into such cases. Maybe a sane-ish approach would be to change <( to only ever increase .from, and )> to only decrease .to. A static compile-time error would be nice too, but I guess it won't be able to capture all cases, like when <( and )> are only used in some branches of an a conjunction or disjunction.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org