From: Bas van Sisseren Date: Wed, 26 Oct 2005 13:59:42 +0000 (+0200) Subject: A B::Deparse fix from : X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=80b7d6d21a210be1e3f8b895dc124aa24c96d7df;p=p5sagit%2Fp5-mst-13.2.git A B::Deparse fix from : Subject: Re: [perl #37527] regular-expression parser does not see '(' character Message-ID: <435F6FAE.4060502@quarantainenet.nl> p4raw-id: //depot/perl@25934 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index 3db6fbe..218ab9c 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -19,7 +19,7 @@ use B qw(class main_root main_start main_cv svref_2object opnumber perlstring CVf_METHOD CVf_LOCKED CVf_LVALUE CVf_ASSERTION PMf_KEEP PMf_GLOBAL PMf_CONTINUE PMf_EVAL PMf_ONCE PMf_SKIPWHITE PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED); -$VERSION = 0.71; +$VERSION = 0.72; use strict; use vars qw/$AUTOLOAD/; use warnings (); @@ -3369,14 +3369,16 @@ sub re_unback { sub balanced_delim { my($str) = @_; my @str = split //, $str; - my($ar, $open, $close, $fail, $c, $cnt); + my($ar, $open, $close, $fail, $c, $cnt, $last_bs); for $ar (['[',']'], ['(',')'], ['<','>'], ['{','}']) { ($open, $close) = @$ar; - $fail = 0; $cnt = 0; + $fail = 0; $cnt = 0; $last_bs = 0; for $c (@str) { if ($c eq $open) { + $fail = 1 if $last_bs; $cnt++; } elsif ($c eq $close) { + $fail = 1 if $last_bs; $cnt--; if ($cnt < 0) { # qq()() isn't ")(" @@ -3384,6 +3386,7 @@ sub balanced_delim { last; } } + $last_bs = $c eq '\\'; } $fail = 1 if $cnt != 0; return ($open, "$open$str$close") if not $fail;