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 (_end_line), tp/Texin


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_end_line), tp/Texinfo/XS/parsetexi/end_line.c (end_line): remove reparenting of empty_line_after_command space container that cannot happen anymore as it is not left when at the end of the line.
Date: Sat, 10 Sep 2022 15:58:34 -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 991f229d41 * tp/Texinfo/ParserNonXS.pm (_end_line), 
tp/Texinfo/XS/parsetexi/end_line.c (end_line): remove reparenting of 
empty_line_after_command space container that cannot happen anymore as it is 
not left when at the end of the line.
991f229d41 is described below

commit 991f229d4177c3fadf94b94a19b33922ea810727
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Sep 10 21:58:24 2022 +0200

    * tp/Texinfo/ParserNonXS.pm (_end_line),
    tp/Texinfo/XS/parsetexi/end_line.c (end_line):
    remove reparenting of empty_line_after_command space container
    that cannot happen anymore as it is not left when at the end
    of the line.
---
 ChangeLog                          | 10 +++++++++-
 tp/Texinfo/ParserNonXS.pm          | 32 --------------------------------
 tp/Texinfo/XS/parsetexi/end_line.c | 30 ------------------------------
 3 files changed, 9 insertions(+), 63 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5c155968ff..7fa77a2fa2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,16 @@
+2022-09-10  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_end_line),
+       tp/Texinfo/XS/parsetexi/end_line.c (end_line):
+       remove reparenting of empty_line_after_command space container
+       that cannot happen anymore as it is not left when at the end
+       of the line.
+
 2022-09-10  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (_end_line),
        tp/Texinfo/XS/parsetexi/end_line.c (end_line_starting_block):
-       remove code never used that is not relevan since there is no
+       remove code never used that is not relevant since there is no
        empty_line_after_command space container left in block command
        argument.
 
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 6bd0fa82e7..38103c4beb 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -3571,38 +3571,6 @@ sub _end_line($$$)
         }
       }
     }
-   # do that last in order to have the line processed if one of the above
-   # case is also set.
-  } elsif (
-      $current->{'contents'}
-      and (scalar(@{$current->{'contents'}}) == 1
-           and (($current->{'contents'}->[-1]->{'type'}
-               and $current->{'contents'}->[-1]->{'type'} eq 
'internal_empty_line_after_command'))
-          or (scalar(@{$current->{'contents'}}) == 2
-               and $current->{'contents'}->[-1]->{'cmdname'}
-               and ($current->{'contents'}->[-1]->{'cmdname'} eq 'c'
-                    or $current->{'contents'}->[-1]->{'cmdname'} eq 'comment')
-               and $current->{'contents'}->[-2]
-               and $current->{'contents'}->[-2]->{'type'}
-               and $current->{'contents'}->[-2]->{'type'} eq 
'internal_empty_line_after_command'))) {
-    # empty line after a @menu or before a preformatted. Reparent to the menu
-    # or other format
-    if ($current->{'type'} and $current->{'type'} eq 'preformatted') {
-      my $parent = $current->{'parent'};
-      if ($parent->{'type'} and $parent->{'type'} eq 'menu_comment'
-          and scalar(@{$parent->{'contents'}}) == 1) {
-        $parent = $parent->{'parent'};
-      }
-      my $to_reparent = pop @{$parent->{'contents'}};
-      print STDERR "LINE AFTER COMMAND IN PREFORMATTED 
($to_reparent->{'type'})\n"
-              if ($self->{'DEBUG'});
-      while (@{$current->{'contents'}}) {
-        my $content = shift @{$current->{'contents'}};
-        $content->{'parent'} = $parent;
-        push @{$parent->{'contents'}}, $content;
-      }
-      push @{$parent->{'contents'}}, $to_reparent;
-    }
   }
 
   # this happens if there is a nesting of line @-commands on a line.
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 5938cb4713..0ea014444b 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -2237,36 +2237,6 @@ end_line (ELEMENT *current)
     {
       current = end_line_misc_line (current);
     }
-  else if (current->contents.number == 1
-           && current->contents.list[0]->type == 
ET_internal_empty_line_after_command
-           || current->contents.number == 2
-           && current->contents.list[0]->type == 
ET_internal_empty_line_after_command
-           && (current->contents.list[1]->cmd == CM_c
-               || current->contents.list[1]->cmd == CM_comment))
-    {
-      if (current->type == ET_preformatted)
-        {
-          /* Empty line after a @menu, or before a preformatted.  Reparent
-             to the menu or other format. */
-          ELEMENT *parent, *to_reparent;
-
-          parent = current->parent;
-          if (parent->type == ET_menu_comment
-              && parent->contents.number == 1)
-            {
-              parent = parent->parent;
-            }
-          to_reparent = pop_element_from_contents (parent);
-          debug ("LINE AFTER COMMAND IN PREFORMATTED");
-          while (current->contents.number > 0)
-            {
-              ELEMENT *e;
-              e = remove_from_contents (current, 0);
-              add_to_element_contents (parent, e);
-            }
-          add_to_element_contents (parent, to_reparent);
-        }
-    }
 
   /* 'line' or 'def' at top of "context stack" - this happens when
      line commands are nested (always incorrectly?) */



reply via email to

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