texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[7221] move _print_tree


From: gavinsmith0123
Subject: [7221] move _print_tree
Date: Sun, 12 Jun 2016 20:00:08 +0000 (UTC)

Revision: 7221
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7221
Author:   gavin
Date:     2016-06-12 20:00:08 +0000 (Sun, 12 Jun 2016)
Log Message:
-----------
move _print_tree

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Common.pm
    trunk/tp/Texinfo/Parser.pm

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-06-12 19:26:48 UTC (rev 7220)
+++ trunk/ChangeLog     2016-06-12 20:00:08 UTC (rev 7221)
@@ -1,5 +1,11 @@
 2016-06-12  Gavin Smith  <address@hidden>
 
+       * tp/Texinfo/Parser.pm (_print_tree),
+       * tp/Texinfo/Common.pm (print_tree): Move implementation
+       to Common.pm.
+
+2016-06-12  Gavin Smith  <address@hidden>
+
        * tp/Texinfo/Convert/NodeNameNormalization.pm: Remove 
        commented-out code.
 

Modified: trunk/tp/Texinfo/Common.pm
===================================================================
--- trunk/tp/Texinfo/Common.pm  2016-06-12 19:26:48 UTC (rev 7220)
+++ trunk/tp/Texinfo/Common.pm  2016-06-12 20:00:08 UTC (rev 7221)
@@ -2427,6 +2427,24 @@
 
   warn "$str\n";
 }
+
+use Data::Dumper;
+
+my @kept_keys = ('contents', 'cmdname', 'type', 'text', 'args');
+my %kept_keys;
+foreach my $key (@kept_keys) {
+  $kept_keys{$key} = 1;
+}
+sub _filter_print_keys { [grep {$kept_keys{$_}} ( sort keys %{$_[0]} )] };
+sub print_tree($)
+{
+  my $tree = shift;
+  local $Data::Dumper::Sortkeys = \&_filter_print_keys;
+  local $Data::Dumper::Purity = 1;
+  local $Data::Dumper::Indent = 1;
+
+  return Data::Dumper->Dump([$tree]);
+}
 1;
 
 __END__

Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm  2016-06-12 19:26:48 UTC (rev 7220)
+++ trunk/tp/Texinfo/Parser.pm  2016-06-12 20:00:08 UTC (rev 7221)
@@ -1110,20 +1110,11 @@
 }
 
 # For debugging
-my @kept_keys = ('contents', 'cmdname', 'type', 'text', 'args');
-my %kept_keys;
-foreach my $key (@kept_keys) {
-  $kept_keys{$key} = 1;
-}
-sub _filter_print_keys { [grep {$kept_keys{$_}} ( sort keys %{$_[0]} )] };
 sub _print_tree($)
 {
   my $tree = shift;
-  local $Data::Dumper::Sortkeys = \&_filter_print_keys;
-  local $Data::Dumper::Purity = 1;
-  local $Data::Dumper::Indent = 1;
 
-  return Data::Dumper->Dump([$tree]);
+  return Texinfo::Common::print_tree($tree);
 }
 
 sub _register_global_command($$$$)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]