-
Notifications
You must be signed in to change notification settings - Fork 578
regular-expression parser does not see '(' character #8167
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
Comments
From [email protected]Created by [email protected]Running perl on both debian stable as debian unstable. I'm using the Perl code: The next regular expressions also won't work: However, what does work: (note the extra '(') when i replace the m[..] with m{..}, everything works fine. Perl Info
|
From [email protected]On Oct 25, via RT and UNEXPECTED_DATA_AFTERbas@quarantainenet.nlsaid:
This is a bug that has to do with using m[...] and trying to include a This m[abc[def]ghi] is the same as /abc[def]ghi/. Likewise, m[abc[\[]ghi] That's like /abc\[ghi/, except that [\[] is really a char class of one It's got to do with how perl handles backslashes when the character being -- |
The RT System itself - Status changed from 'new' to 'open' |
From @rgsJeff 'japhy' Pinyan wrote:
Yes, and I'm under the impression it's properly documented in |
@rgs - Status changed from 'open' to 'rejected' |
From [email protected]On 25/10/05 16:37, japhy@perlmonk.org via RT wrote:
I understand now. Problem solved by patching B::Deparse, I'll send =====
|
From @rgsBas van Sisseren wrote:
No problem; but send the patch here too. (B::Deparse being a core module.) |
From [email protected]On 26/10/05 13:22, Rafael Garcia-Suarez via RT wrote:
Ok, no problem. I've added an extra check in the balanced_delim function When a '\'.<delimiter character> in the string is found, $fail is set to 1. The code which breaks with the unpatched B::Deparse:use B::Deparse;
|
From [email protected]b__deparse_re-fix.patch--- B/Deparse.pm.orig 2005-10-17 18:17:01.000000000 +0200
+++ B/Deparse.pm 2005-10-26 10:22:25.000000000 +0200
@@ -3367,14 +3367,16 @@
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 ")("
@@ -3382,6 +3384,7 @@
last;
}
}
+ $last_bs = $c eq '\\';
}
$fail = 1 if $cnt != 0;
return ($open, "$open$str$close") if not $fail;
|
From @rgsBas van Sisseren wrote:
Thanks, I applied your change to the development copy of perl |
Migrated from rt.perl.org#37527 (status was 'rejected')
Searchable as RT37527$
The text was updated successfully, but these errors were encountered: