texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/ParserNonXS.pm (_close_command_clean


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_close_command_cleanup), tp/Texinfo/XS/parsetexi/close.c (close_command_cleanup): detect @end as being the last content to reparent from before_item to parent command, instead of using extra key end_command.
Date: Wed, 07 Sep 2022 15:39:38 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new f126008010 * tp/Texinfo/ParserNonXS.pm (_close_command_cleanup), 
tp/Texinfo/XS/parsetexi/close.c (close_command_cleanup): detect @end as being 
the last content to reparent from before_item to parent command, instead of 
using extra key end_command.
f126008010 is described below

commit f1260080109fef1cbd3261aa79c7075d9a4b95ea
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Sep 7 21:39:25 2022 +0200

    * tp/Texinfo/ParserNonXS.pm (_close_command_cleanup),
    tp/Texinfo/XS/parsetexi/close.c (close_command_cleanup):
    detect @end as being the last content to reparent from
    before_item to parent command, instead of using extra key
    end_command.
---
 ChangeLog                       | 8 ++++++++
 tp/Texinfo/ParserNonXS.pm       | 6 ++++--
 tp/Texinfo/XS/parsetexi/close.c | 6 ++----
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 478d60bbc4..690bd333ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-09-07  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_close_command_cleanup),
+       tp/Texinfo/XS/parsetexi/close.c (close_command_cleanup):
+       detect @end as being the last content to reparent from
+       before_item to parent command, instead of using extra key
+       end_command.
+
 2022-09-07  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/TexinfoXML.pm (_convert): instead of
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 62b733806f..72843ff1fd 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -1717,9 +1717,11 @@ sub _close_command_cleanup($$) {
         $before_item = $current->{'contents'}->[0];
       }
       if ($before_item) {
-        if ($current->{'extra'}->{'end_command'}
+        if ($before_item->{'contents'}
+            and scalar(@{$before_item->{'contents'}}) > 0
             and @{$before_item->{'contents'}}
-  and $before_item->{'contents'}->[-1] eq 
$current->{'extra'}->{'end_command'}) {
+            and $before_item->{'contents'}->[-1]->{'cmdname'}
+            and $before_item->{'contents'}->[-1]->{'cmdname'} eq 'end') {
           my $end = pop @{$before_item->{'contents'}};
           $end->{'parent'} = $current;
           push @{$current->{'contents'}}, $end;
diff --git a/tp/Texinfo/XS/parsetexi/close.c b/tp/Texinfo/XS/parsetexi/close.c
index 9336b69826..ebe450d43e 100644
--- a/tp/Texinfo/XS/parsetexi/close.c
+++ b/tp/Texinfo/XS/parsetexi/close.c
@@ -178,10 +178,8 @@ close_command_cleanup (ELEMENT *current)
       if (before_item)
         {
           /* Reparent @end from a ET_before_item to the block command */
-          KEY_PAIR *k = lookup_extra (current, "end_command");
-          ELEMENT *e = k ? k->value : 0;
-          if (k && last_contents_child (before_item)
-              && last_contents_child (before_item) == e)
+          ELEMENT *e = last_contents_child (before_item);
+          if (e && e->cmd == CM_end)
             {
               add_to_element_contents (current,
                                      pop_element_from_contents (before_item));



reply via email to

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