texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp texi2any.pl DebugTexinfo/DebugCount....


From: Patrice Dumas
Subject: texinfo/tp texi2any.pl DebugTexinfo/DebugCount....
Date: Wed, 02 Feb 2011 00:36:20 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/02/02 00:36:20

Modified files:
        tp             : texi2any.pl 
        tp/DebugTexinfo: DebugCount.pm 
        tp/t/results/test_count: commands.pl flushright.pl multitable.pl 

Log message:
        Allow debug counting to be called from texi2any.
        Improve debug count output by adding the text.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/texi2any.pl?cvsroot=texinfo&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/DebugTexinfo/DebugCount.pm?cvsroot=texinfo&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/test_count/commands.pl?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/test_count/flushright.pl?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/test_count/multitable.pl?cvsroot=texinfo&r1=1.3&r2=1.4

Patches:
Index: texi2any.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/texi2any.pl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- texi2any.pl 31 Jan 2011 00:37:21 -0000      1.12
+++ texi2any.pl 2 Feb 2011 00:36:19 -0000       1.13
@@ -132,6 +132,7 @@
 require Texinfo::Parser;
 require Texinfo::Structuring;
 require Texinfo::Convert::Info;
+require DebugTexinfo::DebugCount;
 
 # determine configuration directories.
 
@@ -448,16 +449,17 @@
      if ($value =~ /^undef$/i) {
        $value = undef;
      }
-
+     # special case, this is a pseudo format for debug
+     if ($var eq 'DEBUGCOUNT') {
+       $format = 'debugcount';
+     } else {
      # this is very wrong, but a way to avoid a spurious warning.
-     {
        no warnings 'once';
        if (set_from_cmdline ($var, $value) 
            and exists($Texinfo::Parser::default_configuration{$var})) {
          $parser_default_options->{$var} = $value;
        }
      }
-
    }
  },
  'css-include=s' => address@hidden,
@@ -517,6 +519,11 @@
              'floats' => 1,
              'converter' => sub{Texinfo::Convert::Plaintext->converter(@_)},
            },
+  'debugcount' => {
+             'nodes_tree' => 1,
+             'floats' => 1,
+             'converter' => sub{DebugTexinfo::DebugCount->converter(@_)},
+           },
 );
 
 # Main processing, process all the files given on the command line

Index: DebugTexinfo/DebugCount.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/DebugTexinfo/DebugCount.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- DebugTexinfo/DebugCount.pm  28 Jan 2011 07:24:41 -0000      1.2
+++ DebugTexinfo/DebugCount.pm  2 Feb 2011 00:36:20 -0000       1.3
@@ -38,7 +38,12 @@
   my $command_type = '';
   $command_type .= '@'.$root->{'cmdname'} if ($root->{'cmdname'});
   $command_type .= ":$root->{'type'}" if ($root->{'type'});
-  $command_type .= ":text" if (defined($root->{'text'}));
+  if (defined($root->{'text'})) {
+    $command_type .= ":text";
+    my $text = $root->{'text'};
+    $text =~ s/\n/\\n/g;
+    $command_type .= "|$text|";
+  }
   my $string_before = ' ' x $self->{'level'}. "$command_nr $number_before 
$command_type\n";
   push @{$self->{'debug_count_strings'}}, $string_before;
   

Index: t/results/test_count/commands.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/test_count/commands.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- t/results/test_count/commands.pl    30 Jan 2011 17:00:52 -0000      1.3
+++ t/results/test_count/commands.pl    2 Feb 2011 00:36:20 -0000       1.4
@@ -334,43 +334,43 @@
   [2] (0,0) :paragraph
    [3] (0,0) @TeX
    [3] (0,0)
-   [4] (0,0) :text
+   [4] (0,0) :text|. Ab. |
    [4] (8,0)
    [5] (8,0) @@
    [5] (8,0)
-   [6] (8,0) :text
+   [6] (8,0) :text|. |
    [6] (12,0)
    [7] (12,0) @
 
    [7] (12,0)
    [8] (12,0) @~
    [8] (12,0)
-   [9] (12,0) :text
+   [9] (12,0) :text|, |
    [9] (18,0)
    [10] (18,0) @^
    [10] (18,0)
-   [11] (18,0) :text
+   [11] (18,0) :text|\\n|
    [11] (21,0)
   [2] (22,1)
-  [12] (22,1) :empty_line:text
+  [12] (22,1) :empty_line:text|\\n|
   [12] (23,2)
   [13] (23,2) :paragraph
-   [14] (23,2) :text
+   [14] (23,2) :text|Hohoh\\n|
    [14] (31,2)
   [13] (32,3)
-  [15] (32,3) :empty_line:text
+  [15] (32,3) :empty_line:text|\\n|
   [15] (33,4)
   [16] (33,4) @example
-   [17] (33,4) :empty_line_after_command:text
+   [17] (33,4) :empty_line_after_command:text| \\n|
    [17] (33,4)
    [18] (33,4) :preformatted
-    [19] (33,4) :text
+    [19] (33,4) :text|truc\\n|
     [19] (43,5)
    [18] (43,5)
   [16] (43,5)
-  [20] (43,5) :empty_line_after_command:text
+  [20] (43,5) :empty_line_after_command:text|\\n|
   [20] (43,5)
-  [21] (43,5) :empty_line:text
+  [21] (43,5) :empty_line:text|\\n|
   [21] (44,6)
   [22] (44,6) @vtable
    [23] (44,6) :before_item
@@ -379,21 +379,21 @@
     [25] (44,6) 
      [26] (44,6) @samp
       [27] (44,6) :brace_command_arg
-       [28] (44,6) :text
+       [28] (44,6) :text|vitem table|
        [28] (50,6)
       [27] (50,6)
      [26] (50,6)
     [25] (50,6)
    [24] (58,7)
  locations  (1) l 7
-   [29] (58,7) :empty_line:text
+   [29] (58,7) :empty_line:text|\\n|
    [29] (59,8)
    [30] (59,8) :paragraph
-    [31] (59,8) :text
+    [31] (59,8) :text|text\\n|
     [31] (68,8)
    [30] (69,9)
   [22] (69,9)
-  [32] (69,9) :empty_line_after_command:text
+  [32] (69,9) :empty_line_after_command:text||
   [32] (69,9)
  [1] (69,9)
 TeX. Ab.  @.   e~, i^

Index: t/results/test_count/flushright.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/test_count/flushright.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- t/results/test_count/flushright.pl  28 Jan 2011 23:54:31 -0000      1.3
+++ t/results/test_count/flushright.pl  2 Feb 2011 00:36:20 -0000       1.4
@@ -342,69 +342,69 @@
 
 
 $result_converted{'debugcount'}->{'flushright'} = ' [1] (0,0) :text_root
-  [2] (0,0) :empty_line:text
+  [2] (0,0) :empty_line:text|\\n|
   [2] (1,1)
   [3] (1,1) @flushright
-   [4] (1,1) :empty_line_after_command:text
+   [4] (1,1) :empty_line_after_command:text|\\n|
    [4] (1,1)
-   [5] (1,1) :empty_spaces_before_paragraph:text
+   [5] (1,1) :empty_spaces_before_paragraph:text|  |
    [5] (1,1)
    [6] (1,1) :paragraph
-    [7] (0,0) :text
+    [7] (0,0) :text|aaa bb |
     [7] (6,0)
     [8] (6,0) @anchor
     [8] (6,0)
  locations  (1) l 0 b 6
-    [9] (6,0) :empty_spaces_after_close_brace:text
+    [9] (6,0) :empty_spaces_after_close_brace:text| |
     [9] (6,0)
-    [10] (6,0) :text
+    [10] (6,0) :text|ada   \\n|
     [10] (11,1)
-    [11] (11,1) :text
+    [11] (11,1) :text| dad  sff sd |
     [11] (21,1)
     [12] (21,1) @anchor
     [12] (21,1)
  locations  (2) l 1 b 21
-    [13] (21,1) :empty_spaces_after_close_brace:text
+    [13] (21,1) :empty_spaces_after_close_brace:text| |
     [13] (21,1)
-    [14] (21,1) :text
+    [14] (21,1) :text|and |
     [14] (25,1)
     [15] (25,1) @anchor
     [15] (25,1)
  locations  (3) l 1 b 25
-    [16] (25,1) :empty_spaces_after_close_brace:text
+    [16] (25,1) :empty_spaces_after_close_brace:text| |
     [16] (25,1)
-    [17] (25,1) :text
+    [17] (25,1) :text|dsdbf\\n|
     [17] (32,2)
    [6] (143,3)
  locations  (1) l 1 b 68 (2) l 2 b 134 (3) l 2 b 138
-   [18] (143,3) :empty_line:text
+   [18] (143,3) :empty_line:text|\\n|
    [18] (144,4)
    [19] (144,4) :paragraph
-    [20] (0,0) :text
+    [20] (0,0) :text|dqs\\n|
     [20] (4,1)
-    [21] (4,1) :text
+    [21] (4,1) :text|sqdd\\n|
     [21] (9,2)
    [19] (286,6)
-   [22] (286,6) :empty_line:text
+   [22] (286,6) :empty_line:text|\\n|
    [22] (287,7)
    [23] (287,7) :paragraph
     [24] (0,0) @anchor
     [24] (0,0)
  locations  (4) l 0 b 0
-    [25] (0,0) :empty_spaces_after_close_brace:text
+    [25] (0,0) :empty_spaces_after_close_brace:text|\\n|
     [25] (0,0)
    [23] (287,7)
  locations  (4) l 7 b 287
-   [26] (287,7) :empty_line:text
+   [26] (287,7) :empty_line:text|\\n|
    [26] (288,8)
    [27] (288,8) :paragraph
-    [28] (0,0) :text
+    [28] (0,0) :text|new para.\\n|
     [28] (10,1)
    [27] (359,9)
-   [29] (359,9) :empty_line:text
+   [29] (359,9) :empty_line:text|\\n|
    [29] (360,10)
   [3] (360,10)
-  [30] (360,10) :empty_line_after_command:text
+  [30] (360,10) :empty_line_after_command:text|\\n|
   [30] (360,10)
  [1] (360,10)
 

Index: t/results/test_count/multitable.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/test_count/multitable.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- t/results/test_count/multitable.pl  28 Jan 2011 23:54:31 -0000      1.3
+++ t/results/test_count/multitable.pl  2 Feb 2011 00:36:20 -0000       1.4
@@ -376,50 +376,50 @@
 
 
 $result_converted{'debugcount'}->{'multitable'} = ' [1] (0,0) :text_root
-  [2] (0,0) :empty_line:text
+  [2] (0,0) :empty_line:text|\\n|
   [2] (1,1)
   [3] (1,1) @multitable
    [4] (0,0) :bracketed_multitable_prototype
-    [5] (0,0) :text
+    [5] (0,0) :text|aaa|
     [5] (0,0)
    [4] (0,0)
    [6] (0,0) :bracketed_multitable_prototype
-    [7] (0,0) :text
+    [7] (0,0) :text|bb1|
     [7] (0,0)
    [6] (0,0)
    [8] (0,0) :bracketed_multitable_prototype
-    [9] (0,0) :text
+    [9] (0,0) :text|ccc|
     [9] (0,0)
    [8] (0,0)
    [10] (1,1) :before_item
    [10] (1,1)
    [11] (1,1) :row
     [12] (1,1) @item
-     [13] (0,0) :empty_spaces_after_command:text
+     [13] (0,0) :empty_spaces_after_command:text| |
      [13] (0,0)
      [14] (0,0) :paragraph
-      [15] (0,0) :text
+      [15] (0,0) :text|aaa |
       [15] (4,1)
      [14] (4,1)
     [12] (1,1)
     [16] (1,1) @tab
-     [17] (0,0) :empty_spaces_after_command:text
+     [17] (0,0) :empty_spaces_after_command:text| |
      [17] (0,0)
      [18] (0,0) :paragraph
-      [19] (0,0) :text
+      [19] (0,0) :text|bb |
       [19] (2,0)
       [20] (2,0) @anchor
       [20] (2,0)
  locations  (1) l 0 b 2
-      [21] (2,0) :empty_spaces_after_close_brace:text
+      [21] (2,0) :empty_spaces_after_close_brace:text|\\n|
       [21] (2,0)
      [18] (3,1)
     [16] (1,1)
     [22] (1,1) @tab
-     [23] (0,0) :empty_spaces_after_command:text
+     [23] (0,0) :empty_spaces_after_command:text| |
      [23] (0,0)
      [24] (0,0) :paragraph
-      [25] (0,0) :text
+      [25] (0,0) :text|ccc\\n|
       [25] (4,1)
      [24] (4,1)
     [22] (1,1)
@@ -427,24 +427,24 @@
  locations  (1) l 1 b 9
    [26] (17,2) :row
     [27] (17,2) @item
-     [28] (0,0) :empty_spaces_after_command:text
+     [28] (0,0) :empty_spaces_after_command:text| |
      [28] (0,0)
     [27] (17,2)
     [29] (17,2) @tab
-     [30] (0,0) :empty_spaces_after_command:text
+     [30] (0,0) :empty_spaces_after_command:text| |
      [30] (0,0)
      [31] (0,0) :paragraph
       [32] (0,0) @anchor
       [32] (0,0)
  locations  (2) l 0 b 0
-      [33] (0,0) :empty_spaces_after_close_brace:text
+      [33] (0,0) :empty_spaces_after_close_brace:text|\\n|
       [33] (0,0)
      [31] (0,0)
     [29] (17,2)
    [26] (24,3)
  locations  (2) l 2 b 23
   [3] (24,3)
-  [34] (24,3) :empty_line_after_command:text
+  [34] (24,3) :empty_line_after_command:text|\\n|
   [34] (24,3)
  [1] (24,3)
 



reply via email to

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