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

empty groups in regexes should throw "Null pattern not allowed at" errors #1462

Closed
p6rt opened this issue Jan 2, 2010 · 9 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented Jan 2, 2010

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

Searchable as RT71800$

@p6rt
Copy link
Author

p6rt commented Jan 2, 2010

From @masak

This be Rakudo db84bc on Parrot r43174.

$ perl6 -e '/[ ]/'
Null PMC access in find_method('reduce')
[...]

$ perl6 -e '/( )/'
Null PMC access in find_method('reduce')
[...]

Really a PGE bug, but it affects Rakudo.

(Cause​: The .perl6exp traversal nulls the PGE​::Exp​::WS node when it
discovers we're not in a sigspace environment, and that null is not
removed by a parent PGE​::Exp​::Concat, since there's only that one
thing in the brackets. Consequently, the null is still there during
the .reduce traversal.)

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

From @moritz

Now does nothing, but should complain that "Null pattern not allowed"

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

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

@p6rt
Copy link
Author

p6rt commented Apr 30, 2010

From @bbkr

related issue to also put in test suite (Moscow build)​:

perl6 -e 'say /[]/.WHAT'
Divide by zero

@p6rt
Copy link
Author

p6rt commented Sep 13, 2011

From @bbkr

NOM​: still no warning, good point is that it does not divide by zero anymore

bbkr​:nom bbkr$ ./perl6 -e '/[ ]/'
bbkr​:nom bbkr$ ./perl6 -e '/[ ]/.WHAT'
bbkr​:nom bbkr$

@p6rt
Copy link
Author

p6rt commented Nov 15, 2012

From @bbkr

In all those cases STD returns "Null pattern not allowed" error.

2012.10 behavior is incorrect in all of those ceses​:

bbkrimac​:~ ppabian$ perl6 -e '/ [] /'
===SORRY!===
Unrecognized regex metacharacter ] (must be quoted to match literally) at line 2, near " /"

bbkrimac​:~ ppabian$ perl6 -e '/ () /'
===SORRY!===
Unrecognized regex metacharacter ) (must be quoted to match literally) at line 2, near " /"

bbkrimac​:~ ppabian$ perl6 -e '/ [ ] /.WHAT.say'
Regex()
bbkrimac​:~ ppabian$ perl6 -e '/ ( ) /.WHAT.say'
Regex()

@p6rt
Copy link
Author

p6rt commented Oct 6, 2014

From @usev6

Now all of these die with X​::Syntax​::Regex​::NullRegex. There are tests in S32-exceptions/misc.t.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 6, 2014

From @usev6

Now all of these die with X​::Syntax​::Regex​::NullRegex. There are tests in S32-exceptions/misc.t.

@p6rt
Copy link
Author

p6rt commented Oct 6, 2014

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

@p6rt p6rt closed this as completed Oct 6, 2014
@p6rt p6rt added the Bug label Jan 5, 2020
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