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_menu_entry


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_end_line_menu_entry, _end_line), tp/Texinfo/XS/parsetexi/end_line.c (end_line), tp/Texinfo/XS/parsetexi/menus.c (end_line_menu_entry): put code handling end of menu entry from end_line in its own function end_line_menu_entry.
Date: Fri, 03 Mar 2023 02:44:14 -0500

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 581bac3f39 * tp/Texinfo/ParserNonXS.pm (_end_line_menu_entry, 
_end_line), tp/Texinfo/XS/parsetexi/end_line.c (end_line), 
tp/Texinfo/XS/parsetexi/menus.c (end_line_menu_entry): put code handling end of 
menu entry from end_line in its own function end_line_menu_entry.
581bac3f39 is described below

commit 581bac3f39f85575ea27d8a2133a51e5017c24af
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Mar 3 08:44:04 2023 +0100

    * tp/Texinfo/ParserNonXS.pm (_end_line_menu_entry, _end_line),
    tp/Texinfo/XS/parsetexi/end_line.c (end_line),
    tp/Texinfo/XS/parsetexi/menus.c (end_line_menu_entry): put code
    handling end of menu entry from end_line in its own function
    end_line_menu_entry.
    
    * tp/Texinfo/ParserNonXS.pm (_handle_menu_entry_separators),
    tp/Texinfo/XS/parsetexi/menus.c (handle_menu_entry_separators):
    rename handle_menu as handle_menu_entry_separators.
---
 ChangeLog                          |  12 ++
 tp/Texinfo/ParserNonXS.pm          | 230 +++++++++++++++++++------------------
 tp/Texinfo/XS/parsetexi/end_line.c | 136 +---------------------
 tp/Texinfo/XS/parsetexi/menus.c    | 138 +++++++++++++++++++++-
 tp/Texinfo/XS/parsetexi/parser.c   |   4 +-
 tp/Texinfo/XS/parsetexi/parser.h   |   4 +-
 6 files changed, 276 insertions(+), 248 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 61aa67a19d..f7aa4c4380 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2023-03-03  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_end_line_menu_entry, _end_line),
+       tp/Texinfo/XS/parsetexi/end_line.c (end_line),
+       tp/Texinfo/XS/parsetexi/menus.c (end_line_menu_entry): put code
+       handling end of menu entry from end_line in its own function
+       end_line_menu_entry.
+
+       * tp/Texinfo/ParserNonXS.pm (_handle_menu_entry_separators),
+       tp/Texinfo/XS/parsetexi/menus.c (handle_menu_entry_separators):
+       rename handle_menu as handle_menu_entry_separators.
+
 2023-03-02  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line)
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 6fd0ff70cc..e29e937b8a 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -4093,6 +4093,122 @@ sub _end_line_starting_block($$$)
   return $current;
 }
 
+sub _end_line_menu_entry ($$$)
+{
+  my $self = shift;
+  my $current = shift;
+  my $source_info = shift;
+
+  my $empty_menu_entry_node = 0;
+  my $end_comment;
+  if ($current->{'type'} eq 'menu_entry_node') {
+    if (@{$current->{'contents'}}
+        and $current->{'contents'}->[-1]->{'cmdname'}
+        and ($current->{'contents'}->[-1]->{'cmdname'} eq 'c'
+          or $current->{'contents'}->[-1]->{'cmdname'} eq 'comment')) {
+      $end_comment = _pop_element_from_contents($self, $current);
+    }
+    if (not $current->{'contents'} or not scalar(@{$current->{'contents'}})
+         # empty if only the end of line or spaces, including non ascii spaces
+         or (@{$current->{'contents'}} == 1
+             and defined($current->{'contents'}->[-1]->{'text'})
+             and $current->{'contents'}->[-1]->{'text'} !~ /\S/)) {
+      $empty_menu_entry_node = 1;
+      push @{$current->{'contents'}}, $end_comment if ($end_comment);
+    }
+  }
+  # we abort the menu entry if there is no node name
+  if ($empty_menu_entry_node or $current->{'type'} eq 'menu_entry_name') {
+    my $description_or_menu_comment;
+    my $menu_type_reopened = 'menu_description';
+    print STDERR "FINALLY NOT MENU ENTRY\n" if ($self->{'DEBUG'});
+    my $menu = $current->{'parent'}->{'parent'};
+    my $menu_entry = _pop_element_from_contents($self, $menu);
+    if ($menu->{'contents'} and scalar(@{$menu->{'contents'}})
+        and $menu->{'contents'}->[-1]->{'type'}
+        and $menu->{'contents'}->[-1]->{'type'} eq 'menu_entry') {
+      my $entry = $menu->{'contents'}->[-1];
+      my $description;
+      foreach my $entry_element (reverse(@{$entry->{'contents'}})) {
+        if ($entry_element->{'type'} eq 'menu_entry_description') {
+          $description = $entry_element;
+          last;
+        }
+      }
+      if ($description) {
+        $description_or_menu_comment = $description;
+      } else {
+        # Normally this cannot happen
+        $self->_bug_message("no description in menu_entry",
+                             $source_info, $current);
+        push @{$entry->{'contents'}}, {'type' => 'menu_entry_description',
+                                   'parent' => $entry, };
+        $description_or_menu_comment = $entry->{'contents'}->[-1];
+      }
+    } elsif ($menu->{'contents'} and scalar(@{$menu->{'contents'}})
+             and $menu->{'contents'}->[-1]->{'type'}
+             and $menu->{'contents'}->[-1]->{'type'} eq 'menu_comment') {
+      $description_or_menu_comment = $menu->{'contents'}->[-1];
+      $menu_type_reopened = 'menu_comment';
+    }
+    if ($description_or_menu_comment) {
+      $current = $description_or_menu_comment;
+      if ($current->{'contents'}->[-1]
+          and $current->{'contents'}->[-1]->{'type'}
+          and $current->{'contents'}->[-1]->{'type'} eq 'preformatted') {
+        $current = $current->{'contents'}->[-1];
+      } else {
+        # this should not happen
+        $self->_bug_message("description or menu comment not in preformatted",
+                            $source_info, $current);
+        push @{$current->{'contents'}}, {'type' => 'preformatted',
+                                  'parent' => $current, };
+        $current = $current->{'contents'}->[-1];
+      }
+    } else {
+      push @{$menu->{'contents'}}, {'type' => 'menu_comment',
+                                  'parent' => $menu,
+                                  'contents' => [] };
+      $current = $menu->{'contents'}->[-1];
+      push @{$current->{'contents'}}, {'type' => 'preformatted',
+                                'parent' => $current, };
+      $current = $current->{'contents'}->[-1];
+      print STDERR "THEN MENU_COMMENT OPEN\n" if ($self->{'DEBUG'});
+    }
+    # source marks tested in t/*macro.t macro_in_menu_comment_like_entry
+    while (@{$menu_entry->{'contents'}}) {
+      my $arg = shift @{$menu_entry->{'contents'}};
+      if (defined($arg->{'text'})) {
+        $current = _merge_text($self, $current, $arg->{'text'}, $arg);
+      } elsif ($arg->{'contents'}) {
+        while (@{$arg->{'contents'}}) {
+          my $content = shift @{$arg->{'contents'}};
+          if (defined($content->{'text'})) {
+            $current = _merge_text($self, $current, $content->{'text'},
+                                   $content);
+            $content = undef;
+          } else {
+            $content->{'parent'} = $current;
+            push @{$current->{'contents'}}, $content;
+          }
+        }
+      }
+      $arg = undef;
+    }
+    # MENU_COMMENT open
+    $menu_entry = undef;
+  } else {
+    print STDERR "MENU ENTRY END LINE\n" if ($self->{'DEBUG'});
+    $current = $current->{'parent'};
+    $current = _enter_menu_entry_node($self, $current, $source_info);
+    if (defined($end_comment)) {
+      $end_comment->{'parent'} = $current;
+      push @{$current->{'contents'}}, $end_comment;
+    }
+  }
+  return $current;
+}
+
 # close constructs and do stuff at end of line (or end of the document)
 sub _end_line($$$);
 sub _end_line($$$)
@@ -4159,113 +4275,7 @@ sub _end_line($$$)
   } elsif ($current->{'type'}
     and ($current->{'type'} eq 'menu_entry_name'
      or $current->{'type'} eq 'menu_entry_node')) {
-    my $empty_menu_entry_node = 0;
-    my $end_comment;
-    if ($current->{'type'} eq 'menu_entry_node') {
-      if (@{$current->{'contents'}}
-          and $current->{'contents'}->[-1]->{'cmdname'}
-          and ($current->{'contents'}->[-1]->{'cmdname'} eq 'c'
-            or $current->{'contents'}->[-1]->{'cmdname'} eq 'comment')) {
-        $end_comment = _pop_element_from_contents($self, $current);
-      }
-      if (not $current->{'contents'} or not scalar(@{$current->{'contents'}})
-           # empty if only the end of line or spaces, including non ascii 
spaces
-           or (@{$current->{'contents'}} == 1
-               and defined($current->{'contents'}->[-1]->{'text'})
-               and $current->{'contents'}->[-1]->{'text'} !~ /\S/)) {
-        $empty_menu_entry_node = 1;
-        push @{$current->{'contents'}}, $end_comment if ($end_comment);
-      }
-    }
-    # we abort the menu entry if there is no node name
-    if ($empty_menu_entry_node or $current->{'type'} eq 'menu_entry_name') {
-      my $description_or_menu_comment;
-      my $menu_type_reopened = 'menu_description';
-      print STDERR "FINALLY NOT MENU ENTRY\n" if ($self->{'DEBUG'});
-      my $menu = $current->{'parent'}->{'parent'};
-      my $menu_entry = _pop_element_from_contents($self, $menu);
-      if ($menu->{'contents'} and scalar(@{$menu->{'contents'}})
-          and $menu->{'contents'}->[-1]->{'type'}
-          and $menu->{'contents'}->[-1]->{'type'} eq 'menu_entry') {
-        my $entry = $menu->{'contents'}->[-1];
-        my $description;
-        foreach my $entry_element (reverse(@{$entry->{'contents'}})) {
-          if ($entry_element->{'type'} eq 'menu_entry_description') {
-            $description = $entry_element;
-            last;
-          }
-        }
-        if ($description) {
-          $description_or_menu_comment = $description;
-        } else {
-          # Normally this cannot happen
-          $self->_bug_message("no description in menu_entry",
-                               $source_info, $current);
-          push @{$entry->{'contents'}}, {'type' => 'menu_entry_description',
-                                     'parent' => $entry, };
-          $description_or_menu_comment = $entry->{'contents'}->[-1];
-        }
-      } elsif ($menu->{'contents'} and scalar(@{$menu->{'contents'}})
-               and $menu->{'contents'}->[-1]->{'type'}
-               and $menu->{'contents'}->[-1]->{'type'} eq 'menu_comment') {
-        $description_or_menu_comment = $menu->{'contents'}->[-1];
-        $menu_type_reopened = 'menu_comment';
-      }
-      if ($description_or_menu_comment) {
-        $current = $description_or_menu_comment;
-        if ($current->{'contents'}->[-1]
-            and $current->{'contents'}->[-1]->{'type'}
-            and $current->{'contents'}->[-1]->{'type'} eq 'preformatted') {
-          $current = $current->{'contents'}->[-1];
-        } else {
-          # this should not happen
-          $self->_bug_message("description or menu comment not in 
preformatted",
-                              $source_info, $current);
-          push @{$current->{'contents'}}, {'type' => 'preformatted',
-                                    'parent' => $current, };
-          $current = $current->{'contents'}->[-1];
-        }
-      } else {
-        push @{$menu->{'contents'}}, {'type' => 'menu_comment',
-                                    'parent' => $menu,
-                                    'contents' => [] };
-        $current = $menu->{'contents'}->[-1];
-        push @{$current->{'contents'}}, {'type' => 'preformatted',
-                                  'parent' => $current, };
-        $current = $current->{'contents'}->[-1];
-        print STDERR "THEN MENU_COMMENT OPEN\n" if ($self->{'DEBUG'});
-      }
-      # source marks tested in t/*macro.t macro_in_menu_comment_like_entry
-      while (@{$menu_entry->{'contents'}}) {
-        my $arg = shift @{$menu_entry->{'contents'}};
-        if (defined($arg->{'text'})) {
-          $current = _merge_text($self, $current, $arg->{'text'}, $arg);
-        } elsif ($arg->{'contents'}) {
-          while (@{$arg->{'contents'}}) {
-            my $content = shift @{$arg->{'contents'}};
-            if (defined($content->{'text'})) {
-              $current = _merge_text($self, $current, $content->{'text'},
-                                     $content);
-              $content = undef;
-            } else {
-              $content->{'parent'} = $current;
-              push @{$current->{'contents'}}, $content;
-            }
-          }
-        }
-        $arg = undef;
-      }
-      # MENU_COMMENT open
-      $menu_entry = undef;
-    } else {
-      print STDERR "MENU ENTRY END LINE\n" if ($self->{'DEBUG'});
-      $current = $current->{'parent'};
-      $current = _enter_menu_entry_node($self, $current, $source_info);
-      if (defined($end_comment)) {
-        $end_comment->{'parent'} = $current;
-        push @{$current->{'contents'}}, $end_comment;
-      }
-    }
+    $current = _end_line_menu_entry($self, $current, $source_info);
   # block command lines
   } elsif ($current->{'type'}
             and $current->{'type'} eq 'block_line_arg') {
@@ -4799,7 +4809,7 @@ sub _handle_macro($$$$$)
 # is whether some processing was done.  The line and current element are
 # passed by reference. For the current element this is achieved by putting
 # the element in an array reference which is passed to the function.
-sub _handle_menu ($$$$$$)
+sub _handle_menu_entry_separators($$$$$$)
 {
   my $self = shift;
   my $current_array_ref = shift;
@@ -5436,8 +5446,8 @@ sub _process_remaining_on_line($$$$)
       }
       $current = $current->{'parent'};
     }
-  } elsif (_handle_menu($self, \@current_array_for_ref, \$line, $source_info,
-                        $asterisk, $menu_separator)) {
+  } elsif (_handle_menu_entry_separators($self, \@current_array_for_ref,
+                        \$line, $source_info, $asterisk, $menu_separator)) {
     $current = $current_array_for_ref[0];
   # Any other @-command.
   } elsif ($command) {
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 7995a326d5..4f37604f8f 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -1514,7 +1514,7 @@ end_line_starting_block (ELEMENT *current)
   if (command_data(command).data == BLOCK_menu)
     {
       /* Start reading a menu.  Processing will continue in
-         handle_menu in menus.c. */
+         in menus.c. */
 
       ELEMENT *menu_comment = new_element (ET_menu_comment);
       add_to_element_contents (current, menu_comment);
@@ -2275,141 +2275,11 @@ end_line (ELEMENT *current)
           current = end_paragraph (current, 0, 0);
         }
     }
-  /* The end of the line of a menu. */
+  /* The end of the line of a menu entry, without description. */
   else if (current->type == ET_menu_entry_name
            || current->type == ET_menu_entry_node)
     {
-      ELEMENT *end_comment = 0;
-      int empty_menu_entry_node = 0;
-
-      if (current->type == ET_menu_entry_node)
-        {
-          ELEMENT *last = last_contents_child (current);
-
-          if (current->contents.number > 0
-              && (last->cmd == CM_c || last->cmd == CM_comment))
-            {
-              end_comment = pop_element_from_contents (current);
-            }
-
-          /* If contents empty or is all whitespace. */
-          if (current->contents.number == 0
-              || (current->contents.number == 1
-                  && last->text.end > 0
-                  && !last->text.text[strspn (last->text.text, 
-                                              whitespace_chars)]))
-            {
-              empty_menu_entry_node = 1;
-              if (end_comment)
-                add_to_element_contents (current, end_comment);
-            }
-        }
-
-      /* Abort the menu entry if there is no destination node given. */
-      if (empty_menu_entry_node || current->type == ET_menu_entry_name)
-        {
-          ELEMENT *menu, *menu_entry, *description_or_menu_comment = 0;
-          debug ("FINALLY NOT MENU ENTRY");
-          menu = current->parent->parent;
-          menu_entry = pop_element_from_contents (menu);
-          if (menu->contents.number > 0
-              && last_contents_child(menu)->type == ET_menu_entry)
-            {
-              ELEMENT *entry, *description = 0;
-              int j;
-
-              entry = last_contents_child(menu);
-              for (j = entry->contents.number - 1; j >= 0; j--)
-                {
-                  ELEMENT *e = contents_child_by_index (entry, j);
-                  if (e->type == ET_menu_entry_description)
-                    {
-                      description = e;
-                      break;
-                    }
-                }
-              if (description)
-                description_or_menu_comment = description;
-              else
-                {
-                  ELEMENT *e;
-                  /* "Normally this cannot happen." */
-                  bug ("no description in menu entry");
-                  e = new_element (ET_menu_entry_description);
-                  add_to_element_contents (entry, e);
-                  description_or_menu_comment = e;
-                }
-            }
-          else if (menu->contents.number > 0
-                   && last_contents_child(menu)->type == ET_menu_comment)
-            {
-              description_or_menu_comment = last_contents_child(menu);
-            }
-          if (description_or_menu_comment)
-            {
-              current = description_or_menu_comment;
-              if (current->contents.number > 0
-                  && last_contents_child(current)->type == ET_preformatted)
-                current = last_contents_child(current);
-              else
-                {
-                  ELEMENT *e;
-                  /* This should not happen */
-                  bug ("description or menu comment not in preformatted");
-                  e = new_element (ET_preformatted);
-                  add_to_element_contents (current, e);
-                  current = e;
-                }
-            }
-          else
-            {
-              ELEMENT *e;
-              e = new_element (ET_menu_comment);
-              add_to_element_contents (menu, e);
-              current = e;
-              e = new_element (ET_preformatted);
-              add_to_element_contents (current, e);
-              current = e;
-              debug ("THEN MENU_COMMENT OPEN");
-            }
-          {
-          /* source marks tested in *macro.t macro_in_menu_comment_like_entry 
*/
-          int i, j;
-          for (i = 0; i < menu_entry->contents.number; i++)
-            {
-              ELEMENT *arg = contents_child_by_index(menu_entry, i);
-              if (arg->text.end > 0)
-                current = merge_text (current, arg->text.text, arg);
-              else
-                {
-                  ELEMENT *e;
-                  for (j = 0; j < arg->contents.number; j++)
-                    {
-                      e = contents_child_by_index (arg, j);
-                      if (e->text.end > 0)
-                        {
-                          current = merge_text (current, e->text.text, e);
-                          destroy_element (e);
-                        }
-                      else
-                        {
-                          add_to_element_contents (current, e);
-                        }
-                    }
-                }
-              destroy_element (arg);
-            }
-          destroy_element (menu_entry);
-          }
-        }
-      else
-        {
-          debug ("MENU ENTRY END LINE");
-          current = current->parent;
-          current = enter_menu_entry_node (current);
-          if (end_comment)
-            add_to_element_contents (current, end_comment);
-        }
+      current = end_line_menu_entry (current);
     }
   /* End of a line starting a block. */
   else if (current->type == ET_block_line_arg)
diff --git a/tp/Texinfo/XS/parsetexi/menus.c b/tp/Texinfo/XS/parsetexi/menus.c
index 73e4c3570d..9f92bb1a0f 100644
--- a/tp/Texinfo/XS/parsetexi/menus.c
+++ b/tp/Texinfo/XS/parsetexi/menus.c
@@ -101,7 +101,7 @@ enter_menu_entry_node (ELEMENT *current)
 /* Called from 'process_remaining_on_line' in parser.c.  Return 1 if we find
    menu syntax to process, otherwise return 0. */
 int
-handle_menu (ELEMENT **current_inout, char **line_inout)
+handle_menu_entry_separators (ELEMENT **current_inout, char **line_inout)
 {
   ELEMENT *current = *current_inout;
   char *line = *line_inout;
@@ -281,3 +281,139 @@ handle_menu (ELEMENT **current_inout, char **line_inout)
 
   return retval;
 }
+
+ELEMENT *
+end_line_menu_entry (ELEMENT *current)
+{
+  ELEMENT *end_comment = 0;
+  int empty_menu_entry_node = 0;
+
+  if (current->type == ET_menu_entry_node)
+    {
+      ELEMENT *last = last_contents_child (current);
+
+      if (current->contents.number > 0
+          && (last->cmd == CM_c || last->cmd == CM_comment))
+        {
+          end_comment = pop_element_from_contents (current);
+        }
+
+      /* If contents empty or is all whitespace. */
+      if (current->contents.number == 0
+          || (current->contents.number == 1
+              && last->text.end > 0
+              && !last->text.text[strspn (last->text.text,
+                                          whitespace_chars)]))
+        {
+          empty_menu_entry_node = 1;
+          if (end_comment)
+            add_to_element_contents (current, end_comment);
+        }
+    }
+  /* Abort the menu entry if there is no destination node given. */
+  if (empty_menu_entry_node || current->type == ET_menu_entry_name)
+    {
+      ELEMENT *menu, *menu_entry, *description_or_menu_comment = 0;
+      debug ("FINALLY NOT MENU ENTRY");
+      menu = current->parent->parent;
+      menu_entry = pop_element_from_contents (menu);
+      if (menu->contents.number > 0
+          && last_contents_child(menu)->type == ET_menu_entry)
+        {
+          ELEMENT *entry, *description = 0;
+          int j;
+
+          entry = last_contents_child(menu);
+          for (j = entry->contents.number - 1; j >= 0; j--)
+            {
+              ELEMENT *e = contents_child_by_index (entry, j);
+              if (e->type == ET_menu_entry_description)
+                {
+                  description = e;
+                  break;
+                }
+            }
+          if (description)
+            description_or_menu_comment = description;
+          else
+            {
+              ELEMENT *e;
+              /* "Normally this cannot happen." */
+              bug ("no description in menu entry");
+              e = new_element (ET_menu_entry_description);
+              add_to_element_contents (entry, e);
+              description_or_menu_comment = e;
+            }
+        }
+      else if (menu->contents.number > 0
+               && last_contents_child(menu)->type == ET_menu_comment)
+        {
+          description_or_menu_comment = last_contents_child(menu);
+        }
+      if (description_or_menu_comment)
+        {
+          current = description_or_menu_comment;
+          if (current->contents.number > 0
+              && last_contents_child(current)->type == ET_preformatted)
+            current = last_contents_child(current);
+          else
+            {
+              ELEMENT *e;
+              /* This should not happen */
+              bug ("description or menu comment not in preformatted");
+              e = new_element (ET_preformatted);
+              add_to_element_contents (current, e);
+              current = e;
+            }
+        }
+      else
+        {
+          ELEMENT *e;
+          e = new_element (ET_menu_comment);
+          add_to_element_contents (menu, e);
+          current = e;
+          e = new_element (ET_preformatted);
+          add_to_element_contents (current, e);
+          current = e;
+          debug ("THEN MENU_COMMENT OPEN");
+        }
+      {
+      int i, j;
+      for (i = 0; i < menu_entry->contents.number; i++)
+        {
+          ELEMENT *arg = contents_child_by_index(menu_entry, i);
+          if (arg->text.end > 0)
+            current = merge_text (current, arg->text.text, arg);
+          else
+            {
+              ELEMENT *e;
+              for (j = 0; j < arg->contents.number; j++)
+                {
+                  e = contents_child_by_index (arg, j);
+                  if (e->text.end > 0)
+                    {
+                      current = merge_text (current, e->text.text, e);
+                      destroy_element (e);
+                    }
+                  else
+                    {
+                      add_to_element_contents (current, e);
+                    }
+                }
+            }
+          destroy_element (arg);
+        }
+      destroy_element (menu_entry);
+      }
+    }
+  else
+    {
+      debug ("MENU ENTRY END LINE");
+      current = current->parent;
+      current = enter_menu_entry_node (current);
+      if (end_comment)
+        add_to_element_contents (current, end_comment);
+    }
+
+  return current;
+}
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 35a9789ff2..d77d97f210 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -1976,9 +1976,9 @@ process_remaining_on_line (ELEMENT **current_inout, char 
**line_inout)
           current = current->parent;
         }
     }
-  else if (handle_menu (&current, &line))
+  else if (handle_menu_entry_separators (&current, &line))
     {
-      ; /* Nothing - everything was done in handle_menu. */
+      ; /* Nothing - everything was done in handle_menu_entry_separators. */
     }
   /* Any other @-command. */
   else if (cmd)
diff --git a/tp/Texinfo/XS/parsetexi/parser.h b/tp/Texinfo/XS/parsetexi/parser.h
index 09ce620df0..98be29deed 100644
--- a/tp/Texinfo/XS/parsetexi/parser.h
+++ b/tp/Texinfo/XS/parsetexi/parser.h
@@ -245,6 +245,6 @@ KEY_PAIR *lookup_extra (ELEMENT *e, char *key);
 KEY_PAIR *lookup_info (ELEMENT *e, char *key);
 
 /* In menus.c */
-int handle_menu (ELEMENT **current_inout, char **line_inout);
-ELEMENT *enter_menu_entry_node (ELEMENT *current);
+int handle_menu_entry_separators (ELEMENT **current_inout, char **line_inout);
+ELEMENT *end_line_menu_entry (ELEMENT *current);
 #endif



reply via email to

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