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_misc_line)


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_end_line_misc_line) (_end_line_starting_block, _check_register_target_element_label) (_process_remaining_on_line), tp/Texinfo/XS/parsetexi/end_line.c (check_register_target_element_label, end_line_starting_block) (end_line_misc_line), tp/Texinfo/XS/parsetexi/separator.c (handle_close_brace): group together the call of parse_node_manual, the check of no manual element and the registering if a target element for links in _check_register_target_element_label. Re [...]
Date: Tue, 28 Feb 2023 08:49:02 -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 ff8c9595c7 * tp/Texinfo/ParserNonXS.pm (_end_line_misc_line) 
(_end_line_starting_block, _check_register_target_element_label) 
(_process_remaining_on_line), tp/Texinfo/XS/parsetexi/end_line.c 
(check_register_target_element_label, end_line_starting_block) 
(end_line_misc_line), tp/Texinfo/XS/parsetexi/separator.c (handle_close_brace): 
group together the call of parse_node_manual, the check of no manual element 
and the registering if a target element for links in _check_register_targ [...]
ff8c9595c7 is described below

commit ff8c9595c7146f413ab0252f54a5fae0ebe9e561
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Feb 28 14:46:16 2023 +0100

    * tp/Texinfo/ParserNonXS.pm (_end_line_misc_line)
    (_end_line_starting_block, _check_register_target_element_label)
    (_process_remaining_on_line), tp/Texinfo/XS/parsetexi/end_line.c
    (check_register_target_element_label, end_line_starting_block)
    (end_line_misc_line), tp/Texinfo/XS/parsetexi/separator.c
    (handle_close_brace): group together the call of
    parse_node_manual, the check of no manual element and the
    registering if a target element for links in
    _check_register_target_element_label.  Remove _check_internal_node,
    integrated in _check_register_target_element_label.
    
    * tp/Texinfo/XS/parsetexi/end_line.c (parse_node_manual): add an
    argument to control whether the element argument is modified or not.
    Add a field in NODE_SPEC_EXTRA to keep the added elements in case
    the element argument is not modified.  Do not modify the node before
    being sure that there really is a manual name if there is an opening
    brace.  Update callers.
---
 ChangeLog                                       |  20 +++
 tp/TODO                                         |   7 +-
 tp/Texinfo/ParserNonXS.pm                       |  47 +++---
 tp/Texinfo/XS/parsetexi/convert.c               |   2 +
 tp/Texinfo/XS/parsetexi/end_line.c              | 213 ++++++++++++++++--------
 tp/Texinfo/XS/parsetexi/menus.c                 |   2 +-
 tp/Texinfo/XS/parsetexi/parser.h                |   5 +-
 tp/Texinfo/XS/parsetexi/separator.c             |  12 +-
 tp/Texinfo/XS/parsetexi/tree_types.h            |   1 +
 tp/t/results/sectioning/nodename_parentheses.pl |  22 +--
 10 files changed, 202 insertions(+), 129 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 568514733a..0e5a05f22d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2023-02-28  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_end_line_misc_line)
+       (_end_line_starting_block, _check_register_target_element_label)
+       (_process_remaining_on_line), tp/Texinfo/XS/parsetexi/end_line.c
+       (check_register_target_element_label, end_line_starting_block)
+       (end_line_misc_line), tp/Texinfo/XS/parsetexi/separator.c
+       (handle_close_brace): group together the call of
+       parse_node_manual, the check of no manual element and the
+       registering if a target element for links in
+       _check_register_target_element_label.  Remove _check_internal_node,
+       integrated in _check_register_target_element_label.
+
+       * tp/Texinfo/XS/parsetexi/end_line.c (parse_node_manual): add an
+       argument to control whether the element argument is modified or not.
+       Add a field in NODE_SPEC_EXTRA to keep the added elements in case
+       the element argument is not modified.  Do not modify the node before
+       being sure that there really is a manual name if there is an opening
+       brace.  Update callers.
+
 2023-02-27  Gavin Smith <gavinsmith0123@gmail.com>
 
        * doc/texinfo.texi (Other Customization Variables),
diff --git a/tp/TODO b/tp/TODO
index df6b82dbb9..6f2fc162f1 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -13,10 +13,9 @@ Before next release
 Bugs
 ====
 
-To check, there could be memory leaks of node_content/manual_content
-that are not deallocated when the tree is free'd.  If this is the case, it
-may not be easy to fix, as they may have some content in common with
-the element argument.
+Add a function to deallocate NODE_SPEC_EXTRA when parse_node_manual
+was called with modify_node = 0, to deallocate manual, content and
+out_of_tree_element(s)
 
 HTML API
 ========
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index de461c606f..23c6b5f533 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -3479,10 +3479,8 @@ sub _end_line_misc_line($$$)
         }
       }
     }
-    my $node_label_manual_info = _parse_node_manual($current->{'args'}->[0]);
-    _check_internal_node($self, $node_label_manual_info,
-                         $current, $source_info);
-    Texinfo::Common::register_label($self->{'targets'}, $current);
+    _check_register_target_element_label($self, $current->{'args'}->[0],
+                                         $current, $source_info);
     if ($self->{'current_part'}) {
       my $part = $self->{'current_part'};
       if (not $part->{'extra'}
@@ -3850,17 +3848,15 @@ sub _end_line_starting_block($$$)
   # @float args
   if ($command eq 'float') {
     $current->{'source_info'} = $source_info;
-    my $type = '';
-    my $float_label;
-    if ($current->{'args'} and $current->{'args'}->[1]) {
-      $float_label = _parse_node_manual($current->{'args'}->[1]);
-      _check_internal_node($self, $float_label, $current, $source_info);
-    }
+    my $float_label_element;
+    $float_label_element = $current->{'args'}->[1]
+      if ($current->{'args'} and scalar(@{$current->{'args'}}) > 2);
+    _check_register_target_element_label($self, $float_label_element,
+                                         $current, $source_info);
     # for now done in Texinfo::Convert::NodeNameNormalization, but could be
     # good to do in Parser/XS
     #my $float_type = _parse_float_type($current);
     #push @{$self->{'floats'}->{$float_type}}, $current;
-    Texinfo::Common::register_label($self->{'targets'}, $current);
     if (defined($self->{'current_section'})) {
       $current->{'extra'} = {} if (!defined($current->{'extra'}));
       $current->{'extra'}->{'float_section'} = $self->{'current_section'};
@@ -4360,15 +4356,22 @@ sub _start_empty_line_after_command($$$) {
   return $line;
 }
 
-sub _check_internal_node($$$$)
+sub _check_register_target_element_label($$$$)
 {
-  my ($self, $label_info, $target_element, $source_info) = @_;
-
-  if ($label_info and $label_info->{'manual_content'}) {
-    $self->_line_error(sprintf(__("syntax for an external node used for `%s'"),
-        
Texinfo::Convert::Texinfo::target_element_to_texi_label($target_element)),
-                       $source_info);
+  my ($self, $label_element, $target_element, $source_info) = @_;
+
+  if ($label_element) {
+    my ($label_info, $modified_node_content)
+      = Texinfo::Common::parse_node_manual($label_element);
+    if ($label_info and $label_info->{'manual_content'}) {
+      $self->_line_error(sprintf(__("syntax for an external node used for 
`%s'"),
+       # use contents to avoid leading/trailing spaces
+       Texinfo::Convert::Texinfo::convert_to_texinfo(
+                                    {'contents' => 
$label_element->{'contents'}})),
+                         $source_info);
+    }
   }
+  Texinfo::Common::register_label($self->{'targets'}, $target_element);
 }
 
 # Return 1 if an element is all whitespace.
@@ -6278,11 +6281,9 @@ sub _process_remaining_on_line($$$$)
                                $current->{'parent'}->{'cmdname'}),
                                $source_info);
           } else {
-            my $parsed_anchor = _parse_node_manual($current);
-            _check_internal_node($self, $parsed_anchor,
-                                 $current->{'parent'}, $source_info);
-            Texinfo::Common::register_label($self->{'targets'},
-                                            $current->{'parent'});
+            _check_register_target_element_label($self, $current,
+                                                 $current->{'parent'},
+                                                 $source_info);
             # the @anchor element_region information is not used in converters
             if ($self->{'nesting_context'}
                 and $self->{'nesting_context'}->{'regions_stack'}
diff --git a/tp/Texinfo/XS/parsetexi/convert.c 
b/tp/Texinfo/XS/parsetexi/convert.c
index 736d34331a..ed16debfc6 100644
--- a/tp/Texinfo/XS/parsetexi/convert.c
+++ b/tp/Texinfo/XS/parsetexi/convert.c
@@ -30,6 +30,8 @@ static void convert_to_texinfo_internal (ELEMENT *e, TEXT 
*result);
 
 #define ADD(x) text_append (result, x)
 
+/* Currently unused, but could be used to implement link_element_to_texi
+   from Texinfo::Convert::Texinfo */
 /* Return value to be freed by caller. */
 char *
 node_extra_to_texi (NODE_SPEC_EXTRA *nse)
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 6b93757474..dd4ca45163 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -29,18 +29,6 @@
 #include "source_marks.h"
 #include "handle_commands.h"
 
-void
-check_internal_node (NODE_SPEC_EXTRA *nse)
-{
-  if (nse && nse->manual_content
-      && nse->manual_content->contents.number > 0)
-    {
-      char *texi = node_extra_to_texi (nse);
-      line_error ("syntax for an external node used for `%s'", texi);
-      free (texi);
-    }
-}
-
 static int
 is_decimal_number (char *string)
 {
@@ -808,6 +796,35 @@ parse_line_command_args (ELEMENT *line_command)
 #undef ADD_ARG
 }
 
+void
+check_register_target_element_label (ELEMENT *label_element,
+                                     ELEMENT *target_element)
+{
+  if (label_element)
+    {
+      /* check that the label used as an anchor for link target has no
+         external manual part */
+      NODE_SPEC_EXTRA *label_info = parse_node_manual (label_element, 0);
+      if (label_info && label_info->manual_content)
+        {
+          ELEMENT *label_element_contents = new_element (ET_NONE);
+          /* copy contents only to avoid leading/trailing spaces */
+          insert_slice_into_contents (label_element_contents, 0, label_element,
+                                      0, label_element->contents.number);
+          char *texi = convert_to_texinfo (label_element_contents);
+          line_error ("syntax for an external node used for `%s'", texi);
+          free (texi);
+          destroy_element (label_element_contents);
+        }
+      if (label_info->manual_content)
+        destroy_element (label_info->manual_content);
+      if (label_info->node_content)
+        destroy_element (label_info->node_content);
+      free (label_info);
+    }
+  register_label (target_element);
+}
+
 /* NODE->contents is the Texinfo for the specification of a node.  This
    function sets two fields on the returned object:
 
@@ -817,25 +834,43 @@ parse_line_command_args (ELEMENT *line_command)
 
    Objects returned from this function are used as an 'extra' key in
    the element for elements linking to nodes (such as @*ref,
-   menu_entry_node or node direction arguments).
-   They are also used for elements that are targets of links (@node and
+   menu_entry_node or node direction arguments).  In that case
+   modify_node is set to 1 and the node contents are modified in-place to
+   hold the same elements as the returned objects.
+
+   This function is also used for elements that are targets of links (@node and
    @anchor first argument, float second argument) mainly to check that
-   the syntax for an external node is not used. */
+   the syntax for an external node is not used.  In that case modify_node
+   is set to 0 and the node is not modified, and added elements are
+   collected in a thirs field of the returned object,
+     out_of_tree_elements - elements collected in manual_content or
+                            node_content and not in the node
+ */
+
 NODE_SPEC_EXTRA *
-parse_node_manual (ELEMENT *node)
+parse_node_manual (ELEMENT *node, int modify_node)
 {
   NODE_SPEC_EXTRA *result;
-  ELEMENT *new;
+  ELEMENT *node_content = 0;
   int idx = 0; /* index into node->contents */
 
   result = malloc (sizeof (NODE_SPEC_EXTRA));
   result->manual_content = result->node_content = 0;
+  /* if not modifying the tree, and there is a manual name, the elements
+     added for the manual name and for the node content that are based
+     on texts from tree elements are not anywhere in the tree.
+     They are collected in result->out_of_tree_element to be freed later.
+     These elements correspond to the text after the first manual name
+     opening brace and text before and after the closing manual name brace */
+  result->out_of_tree_elements = 0;
 
   /* If the content starts with a '(', try to get a manual name. */
   if (node->contents.number > 0 && node->contents.list[0]->text.end > 0
       && node->contents.list[0]->text.text[0] == '(')
     {
       ELEMENT *manual, *first;
+      ELEMENT *new_first = 0;
+      ELEMENT *opening_brace = 0;
       char *opening_bracket, *closing_bracket;
 
       /* Handle nested parentheses in the manual name, for whatever reason. */
@@ -848,19 +883,28 @@ parse_node_manual (ELEMENT *node)
       first = node->contents.list[0];
       if (first->text.end > 1)
         {
-          memmove (first->text.text, first->text.text + 1, first->text.end);
-          first->text.end--;
-          new = new_element (0);
-          text_append_n (&new->text, "(", 1);
-          insert_into_contents (node, new, 0);
+          if (modify_node)
+            {
+              opening_brace = new_element (0);
+              text_append_n (&opening_brace->text, "(", 1);
+            }
+          new_first = new_element (0);
+          text_append_n (&new_first->text, first->text.text +1, 
first->text.end -1);
+        }
+      else
+        {
+          /* first element is "(", keep it */
+          idx++;
         }
-      idx++;
 
       for (; idx < node->contents.number; idx++)
         {
           ELEMENT *e = node->contents.list[idx];
           char *p, *q;
 
+          if (idx == 0)
+            e = new_first;
+
           if (e->text.end == 0)
             {
               /* Put this element in the manual contents. */
@@ -903,71 +947,119 @@ parse_node_manual (ELEMENT *node)
             add_to_contents_as_array (manual, e);
           else /* end of filename component */
             {
-              /* Split the element in two, putting the part before the ")"
+              /* At this point, we are sure that there is a manual part,
+                 so the pending removal/addition of elements at the beginning
+                 of the manual can proceed (if modify_node). */
+              /* Also, split the element in two, putting the part before the 
")"
                  in the manual name, leaving the part afterwards for the
                  node name. */
-              remove_from_contents (node, idx); /* Remove 'e'. */
-
+              if (modify_node)
+                {
+                  if (opening_brace)
+                    {
+                      /* remove the original first element and prepend the
+                         split "(" and text elements */
+                      remove_from_contents (node, 0); /* remove first element 
*/
+                      destroy_element (first);
+                      insert_into_contents (node, new_first, 0);
+                      insert_into_contents (node, opening_brace, 0);
+                      idx++;
+                    }
+                  remove_from_contents (node, idx); /* Remove current element e
+                                                       with closing brace from 
the tree. */
+                }
+              else
+                {
+                  /* collect elements out of tree */
+                  result->out_of_tree_elements = calloc (3, sizeof (ELEMENT 
*));
+                  if (new_first)
+                    result->out_of_tree_elements[0] = new_first;
+                }
               p--; /* point at ) */
               if (p > e->text.text)
                 {
                   /* text before ), part of the manual name */
-                  new = new_element (ET_NONE);
-                  text_append_n (&new->text, e->text.text,
+                  ELEMENT *last_manual_element = new_element (ET_NONE);
+                  text_append_n (&last_manual_element->text, e->text.text,
                                  p - e->text.text);
-                  insert_into_contents (node, new, idx++);
-
-                  add_to_contents_as_array (manual, new);
+                  add_to_contents_as_array (manual, last_manual_element);
+                  if (modify_node)
+                    insert_into_contents (node, last_manual_element, idx++);
+                  else
+                    result->out_of_tree_elements[1] = last_manual_element;
                 }
 
-              new = new_element (0);
-              text_append_n (&new->text, ")", 1);
-              insert_into_contents (node, new, idx++);
+              if (modify_node)
+                {
+                  ELEMENT *closing_brace = new_element (0);
+                  text_append_n (&closing_brace->text, ")", 1);
+                  insert_into_contents (node, closing_brace, idx++);
+                }
 
               /* Skip ')' and any following whitespace.
                  Note that we don't manage to skip any multibyte
                  UTF-8 space characters here. */
               p++;
               q = p + strspn (p, whitespace_chars);
-              if (q > p)
+              if (q > p && modify_node)
                 {
-                  new = new_element (0);
-                  text_append_n (&new->text, p, q - p);
-                  insert_into_contents (node, new, idx++);
+                  ELEMENT *spaces_element = new_element (0);
+                  text_append_n (&spaces_element->text, p, q - p);
+                  insert_into_contents (node, spaces_element, idx++);
                 }
 
               p = q;
               if (*p)
                 {
                   /* text after ), part of the node name. */
-                  new = new_element (ET_NONE);
-                  text_append_n (&new->text, p,
+                  ELEMENT *leading_node_content = new_element (ET_NONE);
+                  text_append_n (&leading_node_content->text, p,
                                  e->text.text + e->text.end - p);
-                  insert_into_contents (node, new, idx);
+                  /* start node_content */
+                  node_content = new_element (0);
+                  add_to_contents_as_array (node_content, 
leading_node_content);
+                  if (modify_node)
+                    insert_into_contents (node, leading_node_content, idx);
+                  else
+                    result->out_of_tree_elements[2] = leading_node_content;
+                  idx++;
                 }
-              destroy_element (e);
+              if (modify_node)
+                destroy_element (e);
               break;
             }
         } /* for */
 
       if (bracket_count == 0)
         result->manual_content = manual;
-      else /* unbalanced */
+      else /* Unbalanced parentheses, consider that there is no manual
+              afterall.  So far the node has not been modified, so the
+              only thing that needs to be done is to remove the manual
+              element and the elements allocated for the beginning of
+              the manual, and start over */
         {
           destroy_element (manual);
+          if (new_first)
+            destroy_element (new_first);
+          if (opening_brace)
+            destroy_element (opening_brace);
           idx = 0; /* Back to the start, and consider the whole thing
                       as a node name. */
         }
     }
 
-  /* If anything left, it is the node name. */
+  /* If anything left, it is part of the node name. */
   if (idx < node->contents.number)
     {
-      new = new_element (0);
-      insert_slice_into_contents (new, 0, node, idx, node->contents.number);
-      result->node_content = new;
+      if (!node_content)
+        node_content = new_element (0);
+      insert_slice_into_contents (node_content, node_content->contents.number,
+                                  node, idx, node->contents.number);
     }
 
+  if (node_content)
+    result->node_content = node_content;
+
   return result;
 }
 
@@ -1111,20 +1203,13 @@ end_line_starting_block (ELEMENT *current)
   if (command == CM_float)
     {
       char *float_type = "";
+      ELEMENT *float_label_element = 0;
       current->source_info = current_source_info;
       if (current->args.number >= 2)
         {
-          NODE_SPEC_EXTRA *float_label;
-          float_label = parse_node_manual (args_child_by_index (current, 1));
-          check_internal_node (float_label);
-
-          register_label (current);
-          if (float_label->manual_content)
-            destroy_element (float_label->manual_content);
-          if (float_label->node_content)
-            destroy_element (float_label->node_content);
-          free (float_label);
+          float_label_element = args_child_by_index (current, 1);
         }
+      check_register_target_element_label (float_label_element, current);
       /* for now done in Texinfo::Convert::NodeNameNormalization, but could be
          good to do in Parser/XS */
       /*
@@ -1816,7 +1901,7 @@ end_line_misc_line (ELEMENT *current)
       for (i = 1; i < current->args.number && i < 4; i++)
         {
           ELEMENT * arg = current->args.list[i];
-          NODE_SPEC_EXTRA *direction_label_info = parse_node_manual (arg);
+          NODE_SPEC_EXTRA *direction_label_info = parse_node_manual (arg, 1);
           if (direction_label_info->node_content)
             add_extra_contents (arg, "node_content",
                                 direction_label_info->node_content);
@@ -1827,18 +1912,8 @@ end_line_misc_line (ELEMENT *current)
         }
 
       /* Now take care of the node itself */
-      node_label_manual_info = parse_node_manual (current->args.list[0]);
-      check_internal_node (node_label_manual_info);
+      check_register_target_element_label (current->args.list[0], current);
 
-      if (node_label_manual_info)
-        {
-          register_label (current);
-          if (node_label_manual_info->manual_content)
-            destroy_element (node_label_manual_info->manual_content);
-          if (node_label_manual_info->node_content)
-            destroy_element (node_label_manual_info->node_content);
-        }
-      free (node_label_manual_info);
       if (current_part
           && !lookup_extra (current_part, "part_associated_section"))
         {
diff --git a/tp/Texinfo/XS/parsetexi/menus.c b/tp/Texinfo/XS/parsetexi/menus.c
index 1292baf410..120f400fb5 100644
--- a/tp/Texinfo/XS/parsetexi/menus.c
+++ b/tp/Texinfo/XS/parsetexi/menus.c
@@ -51,7 +51,7 @@ register_extra_menu_entry_information (ELEMENT *current)
 
           isolate_last_space (arg);
 
-          parsed_entry_node = parse_node_manual (arg);
+          parsed_entry_node = parse_node_manual (arg, 1);
           if (!parsed_entry_node->manual_content
               && !parsed_entry_node->node_content)
             {
diff --git a/tp/Texinfo/XS/parsetexi/parser.h b/tp/Texinfo/XS/parsetexi/parser.h
index bb13077529..09ce620df0 100644
--- a/tp/Texinfo/XS/parsetexi/parser.h
+++ b/tp/Texinfo/XS/parsetexi/parser.h
@@ -126,14 +126,15 @@ ELEMENT *close_brace_command (ELEMENT *current,
 void close_ignored_block_conditional (ELEMENT *current);
 
 /* In end_line.c */
-NODE_SPEC_EXTRA *parse_node_manual (ELEMENT *node);
+NODE_SPEC_EXTRA *parse_node_manual (ELEMENT *node, int modify_node);
 ELEMENT *end_line (ELEMENT *current);
 ELEMENT *end_line_def_line (ELEMENT *current);
 ELEMENT *end_line_misc_line (ELEMENT *current);
 ELEMENT *end_line_starting_block (ELEMENT *current);
 ELEMENT *parse_special_misc_command (char *line, enum command_id cmd,
                                      int *has_commment);
-void check_internal_node (NODE_SPEC_EXTRA *nse);
+void check_register_target_element_label (ELEMENT *label_element,
+                                          ELEMENT *target_element);
 
 typedef struct {
     char *type;
diff --git a/tp/Texinfo/XS/parsetexi/separator.c 
b/tp/Texinfo/XS/parsetexi/separator.c
index 87fae84061..3f639b7748 100644
--- a/tp/Texinfo/XS/parsetexi/separator.c
+++ b/tp/Texinfo/XS/parsetexi/separator.c
@@ -272,15 +272,7 @@ handle_close_brace (ELEMENT *current, char **line_inout)
                         command_name(current->parent->cmd));
           else
             {
-              NODE_SPEC_EXTRA *parsed_anchor;
-              parsed_anchor = parse_node_manual (current);
-              check_internal_node (parsed_anchor);
-              if (parsed_anchor->manual_content)
-                destroy_element (parsed_anchor->manual_content);
-              if (parsed_anchor->node_content)
-                destroy_element (parsed_anchor->node_content);
-              free (parsed_anchor);
-              register_label (current->parent);
+              check_register_target_element_label (current, current->parent);
               if (nesting_context.regions_stack.top > 0)
                 {
                   add_extra_string_dup (current, "element_region",
@@ -312,7 +304,7 @@ handle_close_brace (ELEMENT *current, char **line_inout)
               else
                 {
                   ELEMENT *arg_label = args_child_by_index (ref, 0);
-                  NODE_SPEC_EXTRA *ref_label_info = parse_node_manual 
(arg_label);
+                  NODE_SPEC_EXTRA *ref_label_info = parse_node_manual 
(arg_label, 1);
 
                   if (ref_label_info && (ref_label_info->manual_content
                                          || ref_label_info->node_content))
diff --git a/tp/Texinfo/XS/parsetexi/tree_types.h 
b/tp/Texinfo/XS/parsetexi/tree_types.h
index f313723691..a40973d1fd 100644
--- a/tp/Texinfo/XS/parsetexi/tree_types.h
+++ b/tp/Texinfo/XS/parsetexi/tree_types.h
@@ -150,6 +150,7 @@ typedef struct INDEX {
 typedef struct {
     ELEMENT *manual_content;
     ELEMENT *node_content;
+    ELEMENT **out_of_tree_elements;
 } NODE_SPEC_EXTRA;
 
 /* For 'def_parsed_hash'. */
diff --git a/tp/t/results/sectioning/nodename_parentheses.pl 
b/tp/t/results/sectioning/nodename_parentheses.pl
index d50ff2c08c..28a35fdf72 100644
--- a/tp/t/results/sectioning/nodename_parentheses.pl
+++ b/tp/t/results/sectioning/nodename_parentheses.pl
@@ -537,16 +537,7 @@ $result_trees{'nodename_parentheses'} = {
         {
           'contents' => [
             {
-              'text' => '('
-            },
-            {
-              'text' => 'manual'
-            },
-            {
-              'text' => ')'
-            },
-            {
-              'text' => 'node'
+              'text' => '(manual)node'
             }
           ],
           'info' => {
@@ -616,16 +607,7 @@ $result_trees{'nodename_parentheses'} = {
             {
               'contents' => [
                 {
-                  'text' => '('
-                },
-                {
-                  'text' => 'manual'
-                },
-                {
-                  'text' => ')'
-                },
-                {
-                  'text' => 'anchor'
+                  'text' => '(manual)anchor'
                 }
               ],
               'type' => 'brace_command_arg'



reply via email to

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