texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Mon, 27 May 2024 11:40:48 -0400 (EDT)

branch: master
commit e970d4eebc6ed21004c66389691ddab3b630f0bd
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon May 27 17:40:34 2024 +0200

    * tp/Texinfo/ParserNonXS.pm (_gather_previous_item),
    tp/Texinfo/XS/parsetexi/multitable.c (gather_previous_item): add a
    debug message.
---
 ChangeLog                            | 6 ++++++
 tp/Texinfo/ParserNonXS.pm            | 8 ++++++--
 tp/Texinfo/XS/parsetexi/multitable.c | 5 ++---
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 58bb3208e4..a0a0dd11a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-27  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_gather_previous_item),
+       tp/Texinfo/XS/parsetexi/multitable.c (gather_previous_item): add a
+       debug message.
+
 2024-05-27  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Translations.pm (configure): warn if $localesdir
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 2506816ea0..36e9ba948c 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -1788,8 +1788,10 @@ sub _gather_previous_item($$;$$)
                     'parent' => $table_entry, };
     push @{$table_entry->{'contents'}}, $table_term;
 
-    # put everything starting from the end until reaching the previous
-    # table entry or beginning of the table in table_term.
+    # We previously collected elements into a table_definition.  Now
+    # do the same for a table_term, starting from the beginning of the
+    # table_definition going back to the previous table entry or beginning
+    # of the table.
     my $contents_count = scalar(@{$current->{'contents'}});
     my $term_begin;
     for (my $i = $begin - 1; $i >= 0; $i--) {
@@ -1820,6 +1822,8 @@ sub _gather_previous_item($$;$$)
     }
     if (defined($before_item) and $before_item->{'contents'}
         and scalar(@{$before_item->{'contents'}})) {
+      print STDERR "REPARENT before_item content\n"
+         if ($self->{'conf'}->{'DEBUG'});
       # reparent any trailing index entries in the before_item to the
       # beginning of table term
       while ($before_item->{'contents'}
diff --git a/tp/Texinfo/XS/parsetexi/multitable.c 
b/tp/Texinfo/XS/parsetexi/multitable.c
index bda5d2cb7d..37a2575dd0 100644
--- a/tp/Texinfo/XS/parsetexi/multitable.c
+++ b/tp/Texinfo/XS/parsetexi/multitable.c
@@ -19,6 +19,7 @@
 #include "tree_types.h"
 #include "tree.h"
 #include "commands.h"
+#include "debug_parser.h"
 #include "errors_parser.h"
 /* check_no_text */
 #include "handle_commands.h"
@@ -149,9 +150,7 @@ gather_previous_item (ELEMENT *current, enum command_id 
next_command)
       remove_slice_from_contents (current, term_begin, begin);
       if (before_item)
         {
-          /* TODO debug message?
-          fprintf (stderr, "REPARENT before_item content\n");
-           */
+          debug ("REPARENT before_item content");
           /* Reparent any trailing index entries in the before_item to the
              beginning of table term. */
           while (before_item->contents.number > 0



reply via email to

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