And as an actual patch:

--- a/src/Perl6/Grammar.pm
+++ b/src/Perl6/Grammar.pm
@@ -1477,6 +1477,7 @@ token quote:sym<s> {
     }
     <.setup_quotepairs>
     [
+    | '/' \s* '/' <.panic: "Null regex in substitution not allowed">
| '/' <p6regex=.LANG('Regex','nibbler')> <?[/]> <quote_EXPR: ':qq'> <.old_rx_mods>?
     | '[' <p6regex=.LANG('Regex','nibbler')> ']'
       <.ws> [ '=' || <.panic: "Missing assignment operator"> ]

But I fear this is the wrong approach. Instead of doing a separate null pattern check in every quoting construct, the check should be done in the regex parsing code once, as STD.pm6 does it.

But I'll leave the final say to pmichaud or jnthn.

Cheers,
Moritz

Reply via email to