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

Weirdness on negative char class “[ ]” #1622

Closed
llelf opened this issue Mar 17, 2018 · 9 comments
Closed

Weirdness on negative char class “[ ]” #1622

llelf opened this issue Mar 17, 2018 · 9 comments

Comments

@llelf
Copy link

llelf commented Mar 17, 2018

> use SomeBigGrammar
Iteration past end of iterator

After WTFing for some time, I found the culprit: /<:SomeClass-[ ]>/.
Even smaller test cases:

> /<-[ ]>/
Iteration past end of iterator

> /<-[]>/
Iteration past end of iterator
perl6 -v

This is Rakudo version 2018.02.1-137-g65874b1555 built on MoarVM version 2018.02-35-g1fca17994
implementing Perl 6.c.

@zoffixznet
Copy link
Contributor

zoffixznet commented Mar 17, 2018

@AlexDaniel
Copy link
Contributor

AlexDaniel commented Mar 17, 2018

OK, but new comments here please. Closing RT#130586 in favor of this ticket.

jstuder-gh added a commit to jstuder-gh/nqp that referenced this issue Mar 23, 2018
It appears that it expects a

Fixes [Rakudo Issue #1622](rakudo/rakudo#1622)
jstuder-gh added a commit to jstuder-gh/nqp that referenced this issue Mar 23, 2018
Check that there is at least one character class before applying the
regex nodes.

When compiling the 'conj' regex node, it expects to be able to shift
off at least one child node and iterates past the end as a result.

Fixes [Rakudo Issue #1622](rakudo/rakudo#1622)
@jstuder-gh
Copy link
Contributor

jstuder-gh commented Mar 23, 2018

I've submitted a PR for NQP that addresses the issue at Raku/nqp#432.
I will submit tests for the roast either tomorrow or over the weekend.

I attempted to have it return a helpful error about empty character classes as jnthn suggested in the RT thread (like so), but then NQP wouldn't build without throwing that error, so I removed it from the branch.

jstuder-gh added a commit to Raku/nqp that referenced this issue Mar 30, 2018
Check that there is at least one character class before applying the
regex nodes.

When compiling the 'conj' regex node, it expects to be able to shift
off at least one child node and iterates past the end as a result.

Fixes [Rakudo Issue #1622](rakudo/rakudo#1622)
@jstuder-gh
Copy link
Contributor

I've merged in the panic-less fix for this issue into the NQP repo. Still need to add tests to the roast.

@jstuder-gh
Copy link
Contributor

jstuder-gh commented Apr 7, 2018

@AlexDaniel
Copy link
Contributor

Tests added in Raku/roast#411, @jstuder-gh++.

@AlexDaniel
Copy link
Contributor

Oh wait, where's the separate panic PR?

@jstuder-gh
Copy link
Contributor

I've submitted the separate PR for the panic behavior here.

@AlexDaniel
Copy link
Contributor

Thanks.

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

No branches or pull requests

4 participants