Upgrade to Text::Balanced 1.84.
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 8 May 2001 13:21:07 +0000 (13:21 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 8 May 2001 13:21:07 +0000 (13:21 +0000)
p4raw-id: //depot/perl@10034

lib/Text/Balanced.pm
t/lib/tb-xbrak.t

index 88218e8..18f9559 100644 (file)
@@ -10,7 +10,7 @@ use Exporter;
 use SelfLoader;
 use vars qw { $VERSION @ISA %EXPORT_TAGS };
 
-$VERSION = '1.83';
+$VERSION = '1.84';
 @ISA           = qw ( Exporter );
                     
 %EXPORT_TAGS   = ( ALL => [ qw(
@@ -233,7 +233,7 @@ sub _match_bracketed($$$$$$)        # $textref, $pre, $ldel, $qdel, $quotelike, $rdel
                }
                elsif ($qdel && $$textref =~ m/\G([$qdel])/gc)
                {
-                       $$textref =~ m/\G[^\\$1]*(?:\\.[^\\$1]*)*(\Q$1\E)/gc and next;
+                       $$textref =~ m/\G[^\\$1]*(?:\\.[^\\$1]*)*(\Q$1\E)/gsc and next;
                        _failmsg "Unmatched embedded quote ($1)",
                                 pos $$textref;
                        pos $$textref = $startpos;
@@ -667,7 +667,7 @@ sub _match_quotelike($$$$)  # ($textref, $prepat, $allow_raw_match)
                     || $rawmatch && $initial =~ m|^/|
                     || $qmark && $initial =~ m|^\?|)
        {
-               unless ($$textref =~ m/ \Q$initial\E [^\\$initial]* (\\.[^\\$initial]*)* \Q$initial\E /gcx)
+               unless ($$textref =~ m/ \Q$initial\E [^\\$initial]* (\\.[^\\$initial]*)* \Q$initial\E /gcsx)
                {
                        _failmsg qq{Did not find closing delimiter to match '$initial' at "} .
                                     substr($$textref, $oppos, 20) .
@@ -720,7 +720,7 @@ sub _match_quotelike($$$$)  # ($textref, $prepat, $allow_raw_match)
                elsif ($$textref =~ m{ \G ' ([^'\\]* (?:\\.[^'\\]*)*) '
                                     | \G " ([^"\\]* (?:\\.[^"\\]*)*) "
                                     | \G ` ([^`\\]* (?:\\.[^`\\]*)*) `
-                                    }gcx) {
+                                    }gcsx) {
                        $label = $+;
                }
                else {
@@ -776,7 +776,7 @@ sub _match_quotelike($$$$)  # ($textref, $prepat, $allow_raw_match)
        }
        else
        {
-               $$textref =~ /$ldel1[^\\$ldel1]*(\\.[^\\$ldel1]*)*$ldel1/gc
+               $$textref =~ /$ldel1[^\\$ldel1]*(\\.[^\\$ldel1]*)*$ldel1/gcs
                || do { pos $$textref = $startpos; return };
        }
        $ld2pos = $rd1pos = pos($$textref)-1;
@@ -811,7 +811,7 @@ sub _match_quotelike($$$$)  # ($textref, $prepat, $allow_raw_match)
                }
                else
                {
-                       $$textref =~ /[^\\$ldel2]*(\\.[^\\$ldel2]*)*$ldel2/gc
+                       $$textref =~ /[^\\$ldel2]*(\\.[^\\$ldel2]*)*$ldel2/gcs
                        || do { pos $$textref = $startpos; return };
                }
                $rd2pos = pos($$textref)-1;
index 8f61160..5a8e524 100644 (file)
@@ -11,7 +11,7 @@ BEGIN {
 # Change 1..1 below to 1..last_test_to_print .
 # (It may become useful if the test is moved to ./t subdirectory.)
 
-BEGIN { $| = 1; print "1..17\n"; }
+BEGIN { $| = 1; print "1..19\n"; }
 END {print "not ok 1\n" unless $loaded;}
 use Text::Balanced qw ( extract_bracketed );
 $loaded = 1;
@@ -58,6 +58,7 @@ __DATA__
 
 # USING: extract_bracketed($str);
 {a nested { and } are okay as are () and <> pairs and escaped \}'s };
+{a nested\n{ and } are okay as are\n() and <> pairs and escaped \}'s };
 
 # USING: extract_bracketed($str,'{}');
 {a nested { and } are okay as are unbalanced ( and < pairs and escaped \}'s };