Subject: | Bleadperl v5.16.0-225-g2a53d33 shouts at DCONWAY/Regexp-Grammars-1.016.tar.gz |
Although all tests pass Regexp::Grammars became nearly unusable because
of the warnings triggered by bleadperl v5.16.0-225-g2a53d33.
That commit introduced mandatory backslash before "{".
Attached patch seems to be a solution, at least all tests pass and all
warnings during testing are silenced.
HTH,
Subject: | Regexp-Grammers-1.016-ANDK-01.diff |
diff -ur ../Regexp-Grammars-1.016-v3XB0T~/lib/Regexp/Grammars.pm ../Regexp-Grammars-1.016-v3XB0T/lib/Regexp/Grammars.pm
--- ../Regexp-Grammars-1.016-v3XB0T~/lib/Regexp/Grammars.pm 2012-03-09 21:01:30.000000000 +0100
+++ ../Regexp-Grammars-1.016-v3XB0T/lib/Regexp/Grammars.pm 2012-06-16 06:02:54.263610470 +0200
@@ -1438,7 +1438,7 @@
my $prev_translation = q{};
# Translate all other calls (MAIN GRAMMAR FOR MODULE)...
- $grammar_spec =~ s{
+ my $pat = qr;
(?<list_marker> (?<ws1> \s*+) (?<op> (?&SEPLIST_OP) ) (?<ws2> \s*+) )?
(?<construct>
<
@@ -1567,7 +1567,7 @@
)
(?(DEFINE)
- (?<SEPLIST_OP> \*\* | [*+?][+?]?\s*% | {\d+(,\d*)?}[+?]?\s*% )
+ (?<SEPLIST_OP> \*\* | [*+?][+?]?\s*% | \{\d+(,\d*)?}[+?]?\s*% )
(?<PARENS> \( (?:[?]<[=!])? (?: \\. | (?&PARENCODE) | (?&PARENS) | (?&CHARSET) | [^][()\\<>]++ )*+ \) )
(?<BRACES> \{ (?: \\. | (?&BRACES) | [^{}\\]++ )*+ \} )
(?<PARENCODE> \(\?\{ (?: \\. | (?&BRACES) | [^{}\\]++ )*+ \}\) )
@@ -1583,9 +1583,10 @@
(?<ARG> (?&VAR) | (?&KEY) \s* => \s* (?&LITERAL) )
(?<VAR> : (?&IDENT) )
(?<KEY> (?&IDENT) | (?&LITERAL) )
- (?<QUANTIFIER> [*+?][+?]? | {\d+,?\d*}[+?]?i )
+ (?<QUANTIFIER> [*+?][+?]? | \{\d+,?\d*}[+?]?i )
)
- }{
+ ;xms;
+ $grammar_spec =~ s{$pat}{
my $curr_construct = $+{construct};
my $alias = ($+{alias}//'MATCH') eq 'MATCH' ? q{'='} : qq{'$+{alias}'};
@@ -1876,7 +1877,7 @@
# Finally, remember this latest translation, and return it...
$prev_construct = $curr_construct;
$prev_translation = $curr_translation;;
- }exmsg;
+ }eg;
# Translate magic hash accesses...
$grammar_spec =~ s{\$MATCH (?= \s*\{) }
@@ -2386,7 +2387,7 @@
# Report anything that starts like a subrule, but isn't...
my %seen = ( '<ws>' => 1, '<hk>' => 1, '<matchpos>' => 1, '<matchline>' => 1); # autogenerated
- while ($regex =~ m{( (?<! \(\? | q\{ ) (?<! \\) < [[.]* $IDENT \s* (:?) .*? [\n>] )}gxms) {
+ while ($regex =~ m;( (?<! \(\? | q\{ ) (?<! \\) < [[.]* $IDENT \s* (:?) .*? [\n>] );gxms) {
my $construct = $1;
my $something = $2 ? 'directive' : 'subrule call';
diff -ur ../Regexp-Grammars-1.016-v3XB0T~/t/local_ws.t ../Regexp-Grammars-1.016-v3XB0T/t/local_ws.t
--- ../Regexp-Grammars-1.016-v3XB0T~/t/local_ws.t 2011-11-01 11:43:21.000000000 +0100
+++ ../Regexp-Grammars-1.016-v3XB0T/t/local_ws.t 2012-06-16 06:08:13.472366025 +0200
@@ -32,7 +32,7 @@
my $test_grammar = do {
use Regexp::Grammars;
- qr{
+ qr!
<program>
@@ -41,7 +41,7 @@
<[statement]> ** ( ; )
<rule: statement>
- <ws: (\s*+ | \#{ .*? }\# )* > # Another type within statements
+ <ws: (\s*+ | \#\{ .*? }\# )* > # Another type within statements
<cmd> <[arg]> ** ( , )
<token: cmd>
@@ -49,7 +49,7 @@
<token: arg>
baz
- }xms;
+ !xms;
};
my $text = q{