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

QRegex: a zerowidth match of CCLASS_NEWLINE advances position by 1 if it matches \r\n #3271

Closed
p6rt opened this issue Nov 11, 2013 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Nov 11, 2013

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

Searchable as RT120511$

@p6rt
Copy link
Author

p6rt commented Nov 11, 2013

From @timo

17​:50 < timotimo> nqp​: say("\r\na" ~~ /<?[\w]>"\r\na"/);
17​:50 <+camelia> nqp-moarvm​: OUTPUT«Substring length (-6) cannot be negative␤Str␤»
17​:50 <+camelia> ..nqp-jvm, nqp-parrot​: OUTPUT«␤»
17​:50 < timotimo> nqp​: say("\r\na" ~~ /"\r\na"/);
17​:50 <+camelia> nqp-moarvm, nqp-jvm, nqp-parrot​: OUTPUT«

the implementation of CCLASS_NEWLINE doesn't have a condition for the addition to pos if it matched a \r\n.

I'll fix this bug on a train ride today.

@p6rt
Copy link
Author

p6rt commented Nov 11, 2013

From @timo

actually, the regex just has to have \n, but it b0rks with \w as well, because that mixes it in.

18​:03 < timotimo> nqp​: say("\r\na" ~~ /<?[\n]>"\r\na"/);
18​:03 <+camelia> nqp-moarvm​: OUTPUT«Substring length (-6) cannot be negative␤Str␤»
18​:03 <+camelia> ..nqp-jvm, nqp-parrot​: OUTPUT«␤»
18​:03 < timotimo> nqp​: say("\r\na" ~~ /"\r\na"/);
18​:03 <+camelia> nqp-moarvm, nqp-jvm, nqp-parrot​: OUTPUT«

@p6rt
Copy link
Author

p6rt commented Nov 11, 2013

From @timo

solved the bug, but it needs to get a test.

ideally, the test would land in qregex/somewhere, but that's giving me trouble with \r\n and different levels of escaping ...

@p6rt
Copy link
Author

p6rt commented Aug 16, 2015

From @FROGGS

Added test to roast instead of nqp​: Raku/roast@c82bbd55ff

@p6rt p6rt closed this as completed Aug 16, 2015
@p6rt
Copy link
Author

p6rt commented Aug 16, 2015

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

@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