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 should die with a better message #1139

Closed
p6rt opened this issue Jul 14, 2009 · 8 comments
Closed

empty groups should die with a better message #1139

p6rt opened this issue Jul 14, 2009 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Jul 14, 2009

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

Searchable as RT67554$

@p6rt
Copy link
Author

p6rt commented Jul 14, 2009

From duff@lighthouse.tamucc.edu

15​:42 <@​PerlJam> rakudo​: say "" ~~ /[]/
15​:42 < p6eval> rakudo eaa3ea​: OUTPUT«Statement not terminated properly at line 2, near "~~ /[]/"␤in Main (src/gen_setting.pm​:3340)␤»
15​:42 <@​PerlJam> rakudo​: say "" ~~ /[ ]/
15​:42 < p6eval> rakudo eaa3ea​: OUTPUT«Null PMC access in find_method()␤in Main (src/gen_setting.pm​:3340)␤»
15​:42 <@​PerlJam> That's just weird.
15​:42 <@​moritz_> PerlJam​: please open a ticket for the last one
15​:42 <@​moritz_> I'm sure that's wrong
15​:42 <@​moritz_> not entirely sure about the others
15​:43 <@​TimToady> std​: say "" ~~ /[]/
15​:43 < p6eval> std 27554​: OUTPUT«##### PARSE FAILED #####␤Unrecognized regex metacharacter at /tmp/BcDXBbF0TI line 1​:␤------> say "" ~~ /[]/␤ expecting ws␤FAILED 00​:04 36m␤»
15​:44 <@​TimToady> should have a better message

The above also holds for capturing groups.

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Aug 23, 2010

From @moritz

21​:13 < moritz_> rakudo​: / | /; say "alive"
21​:13 <+p6eval> rakudo 689bb7​: OUTPUT«alive␤»
21​:13 < moritz_> std​: / | /
21​:13 <+p6eval> std 32092​: OUTPUT«===SORRY!===␤Null pattern not allowed
at /tmp/seCzwubd7Z line 1​:␤------> / | ⏏/␤ expecting
quantifier␤Parse failed␤FAILED 00​:01 115m␤»

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

From @bbkr

NOM

both cases still broken

bbkr​:nom bbkr$ ./perl6 -e 'say "" ~~ /[]/'
===SORRY!===
Unrecognized regex metacharacter (must be quoted to match literally) at
line 1, near "/"
bbkr​:nom bbkr$
bbkr​:nom bbkr$ ./perl6 -e 'say "" ~~ / | /'

(no output for this one)

@p6rt
Copy link
Author

p6rt commented May 29, 2012

From @diakopter

On Sun Sep 11 02​:09​:36 2011, bbkr wrote​:

NOM

both cases still broken

bbkr​:nom bbkr$ ./perl6 -e 'say "" ~~ /[]/'
===SORRY!===
Unrecognized regex metacharacter (must be quoted to match literally) at
line 1, near "/"
bbkr​:nom bbkr$
bbkr​:nom bbkr$ ./perl6 -e 'say "" ~~ / | /'

(no output for this one)

this has a much later duplicate ticket.

@p6rt
Copy link
Author

p6rt commented Feb 23, 2014

From @coke

On Sun Sep 11 02​:09​:36 2011, bbkr wrote​:

NOM

both cases still broken

bbkr​:nom bbkr$ ./perl6 -e 'say "" ~~ /[]/'
===SORRY!===
Unrecognized regex metacharacter (must be quoted to match literally) at
line 1, near "/"
bbkr​:nom bbkr$
bbkr​:nom bbkr$ ./perl6 -e 'say "" ~~ / | /'

(no output for this one)

Both of these now die with "Null regex not allowed" - Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Feb 24, 2014

From @moritz

On Sat Feb 22 17​:15​:34 2014, coke wrote​:

On Sun Sep 11 02​:09​:36 2011, bbkr wrote​:

NOM

both cases still broken

bbkr​:nom bbkr$ ./perl6 -e 'say "" ~~ /[]/'
===SORRY!===
Unrecognized regex metacharacter (must be quoted to match literally) at
line 1, near "/"
bbkr​:nom bbkr$
bbkr​:nom bbkr$ ./perl6 -e 'say "" ~~ / | /'

(no output for this one)

Both of these now die with "Null regex not allowed" - Closable with tests.

Now tested​:

commit 2582eed4dce4c012eb8d2501934e3720568fad8d
Author​: Moritz Lenz <mlenz@​noris.net>
Date​: Mon Feb 24 09​:31​:20 2014 +0100

  Tests for RT #​67554

Inline Patch
diff --git a/S32-exceptions/misc.t b/S32-exceptions/misc.t
index 9aaef14..1dd6284 100644
--- a/S32-exceptions/misc.t
+++ b/S32-exceptions/misc.t
@@ -139,6 +139,9 @@ throws_like q[/ /], X::Syntax::Regex::NullRegex;
 throws_like q[/ a | /], X::Syntax::Regex::NullRegex;
 throws_like q[/ a || /], X::Syntax::Regex::NullRegex;
 throws_like q[/ a & /], X::Syntax::Regex::NullRegex;
+# RT 67554
+throws_like q{/ [] /}, X::Syntax::Regex::NullRegex;
+throws_like q{/ | /}, X::Syntax::Regex::NullRegex;
 
 
 throws_like 'sub f($a?, $b) { }', X::Parameter::WrongOrder,

@p6rt
Copy link
Author

p6rt commented Feb 24, 2014

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

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