Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 7d18065

Converted char_accumulator to an accessor.

  • Participants
  • Parent commits a9ed3b2

Comments (0)

Files changed (1)

File perl/modules/XML-SemanaticDiff/lib/XML/SemanticDiff.pm

 
 use Encode qw(encode_utf8);
 
-foreach my $accessor (qw(descendents))
+foreach my $accessor (qw(descendents char_accumulator))
 {
     no strict 'refs';
     *{__PACKAGE__.'::'.$accessor} = sub {
     };
 }
 
-my $char_accumulator = {};
 my $doc = {};
 my $opts = {};
 
     my $test_context = _calc_test_context();
 
     my $text;
-    if ( defined( $char_accumulator->{$element} )) { 
-        $text = $char_accumulator->{$element};
-        delete $char_accumulator->{$element};
+    if ( defined( $self->char_accumulator()->{$element} )) { 
+        $text = $self->char_accumulator()->{$element};
+        delete $self->char_accumulator()->{$element};
     }
     $text ||= 'o';
     
     $char =~ s/^\s*//;
     $char =~ s/\s*$//;
     $char =~ s/\s+/ /g;
-    $char_accumulator->{$element} .= $char if $char;
+    $self->char_accumulator()->{$element} .= $char if $char;
     
 }
         
     my $expat = shift;
     $doc = {};
     $self->descendents({});
-    $char_accumulator = {};
+    $self->char_accumulator({});
     $opts = $expat->{'Non-Expat-Options'};
     $xml_context = [];
     $PI_position_index = {};