Skip to content

Commit

Permalink
Escape unescaped { chars in regexps to avoid deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowcat-mst committed Aug 23, 2018
1 parent b0d4bba commit db02260
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Revision history for Babble

- Escape unescaped { chars in regexps to avoid deprecation warnings
0.090006
- Work around regexp engine weirditude on 5.18+
0.090005
Expand Down
2 changes: 1 addition & 1 deletion lib/Babble/Plugin/Sigify.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sub transform_to_plain {
my ($m) = @_;
my $body = $m->submatches->{body}->text;
$body =~ s/^\s+//;
if ($body =~ s/^{\s*my\s*(\([^\)]+\))\s*=\s*\@_\s*;/{/sm) {
if ($body =~ s/^\{\s*my\s*(\([^\)]+\))\s*=\s*\@_\s*;/{/sm) {
my $sig = $1;
$body =~ s/^{\n\n/{\n/;
$m->submatches->{body}->replace_text($sig.' '.$body);
Expand Down
2 changes: 1 addition & 1 deletion t/simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $test->each_match_of('SubroutineDeclaration' => sub {
my ($match) = @_;
my $text = $match->text;
my ($name) = $text =~ /\Asub (\w+)/;
$text =~ s/{/{ # define $name/;
$text =~ s/\{/{ # define $name/;
$match->replace_text($text);
});

Expand Down

0 comments on commit db02260

Please sign in to comment.