texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/Texinfo.pm (link_element_to_


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/Texinfo.pm (link_element_to_texi), tp/Texinfo/ParserNonXS.pm (_check_node_label), tp/Texinfo/Structuring.pm: new function that replaces functionally node_extra_to_texi and is applied to an element. Update callers.
Date: Mon, 27 Feb 2023 15:30:03 -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 049fceb955 * tp/Texinfo/Convert/Texinfo.pm (link_element_to_texi), 
tp/Texinfo/ParserNonXS.pm (_check_node_label), tp/Texinfo/Structuring.pm: new 
function that replaces functionally node_extra_to_texi and is applied to an 
element.  Update callers.
049fceb955 is described below

commit 049fceb9557df7a4f7182d1a04df0db7d68710b1
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Feb 27 21:28:28 2023 +0100

    * tp/Texinfo/Convert/Texinfo.pm (link_element_to_texi),
    tp/Texinfo/ParserNonXS.pm (_check_node_label),
    tp/Texinfo/Structuring.pm: new function that replaces functionally
    node_extra_to_texi and is applied to an element.  Update callers.
    
    * tp/Texinfo/Structuring.pm associate_internal_references): more
    common code to handle both types of internal references commands.
    
    * tp/Texinfo/Convert/Texinfo.pm (target_element_to_texi_label): remove
    call to node_extra_to_texi, it cannot happen.
    
    * tp/Texinfo/ParserNonXS.pm (_check_node_label, _check_empty_node),
    tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line),
    tp/Texinfo/XS/parsetexi/end_line.c (check_empty_node)
    (check_node_label), tp/Texinfo/XS/parsetexi/separator.c
    (handle_close_brace): determine directly if an @anchor is empty, and
    call check_internal_node if it is not the case.  Remove
    check_node_label and check_empty_node.
    
    * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line),
    tp/Texinfo/XS/parsetexi/separator.c (handle_close_brace): rename
    arg as arg_label in the code determining @*ref link label information.
    
    * tp/Texinfo/Structuring.pm (nodes_tree): rename $arg as
    $direction_element.
---
 ChangeLog                                        | 28 +++++++++
 tp/Texinfo/Convert/Texinfo.pm                    | 32 +++++------
 tp/Texinfo/ParserNonXS.pm                        | 68 +++++++++-------------
 tp/Texinfo/Structuring.pm                        | 73 ++++++++++++------------
 tp/Texinfo/XS/parsetexi/end_line.c               | 21 -------
 tp/Texinfo/XS/parsetexi/parser.h                 |  2 +-
 tp/Texinfo/XS/parsetexi/separator.c              | 30 ++++++----
 tp/t/results/info_tests/novalidate_empty_refs.pl |  3 +-
 tp/t/results/sectioning/empty_refs.pl            |  3 +-
 9 files changed, 130 insertions(+), 130 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3521a9c890..ad8fa12acf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,34 @@
        Rename 'ASCII_PUNCTUATION' as 'ASCII_DASHES_AND_QUOTES' and
        'NO_GRATUITOUS_UTF8' as 'ASCII_PUNCTUATION'.
 
+2023-02-27  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/Texinfo.pm (link_element_to_texi),
+       tp/Texinfo/ParserNonXS.pm (_check_node_label),
+       tp/Texinfo/Structuring.pm: new function that replaces functionally
+       node_extra_to_texi and is applied to an element.  Update callers.
+
+       * tp/Texinfo/Structuring.pm associate_internal_references): more
+       common code to handle both types of internal references commands.
+
+       * tp/Texinfo/Convert/Texinfo.pm (target_element_to_texi_label): remove
+       call to node_extra_to_texi, it cannot happen.
+
+       * tp/Texinfo/ParserNonXS.pm (_check_node_label, _check_empty_node),
+       tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line),
+       tp/Texinfo/XS/parsetexi/end_line.c (check_empty_node)
+       (check_node_label), tp/Texinfo/XS/parsetexi/separator.c
+       (handle_close_brace): determine directly if an @anchor is empty, and
+       call check_internal_node if it is not the case.  Remove
+       check_node_label and check_empty_node.
+
+       * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line),
+       tp/Texinfo/XS/parsetexi/separator.c (handle_close_brace): rename
+       arg as arg_label in the code determining @*ref link label information.
+
+       * tp/Texinfo/Structuring.pm (nodes_tree): rename $arg as
+       $direction_element.
+
 2023-02-27  Patrice Dumas  <pertusus@free.fr>
 
        * Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_tree): update node
diff --git a/tp/Texinfo/Convert/Texinfo.pm b/tp/Texinfo/Convert/Texinfo.pm
index 75cf0fb8eb..66c0cff509 100644
--- a/tp/Texinfo/Convert/Texinfo.pm
+++ b/tp/Texinfo/Convert/Texinfo.pm
@@ -1,20 +1,20 @@
 # Texinfo.pm: output a Texinfo tree as Texinfo.
 #
 # Copyright 2010-2022 Free Software Foundation, Inc.
-# 
+#
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3 of the License,
 # or (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
-# 
+#
 # Original author: Patrice Dumas <pertusus@free.fr>
 # Parts (also from Patrice Dumas) come from texi2html.pl or texi2html.init.
 
@@ -39,7 +39,7 @@ use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
 
 %EXPORT_TAGS = ( 'all' => [ qw(
   convert_to_texinfo
-  node_extra_to_texi
+  link_element_to_texi
   target_element_to_texi_label
 ) ] );
 
@@ -63,28 +63,26 @@ for my $a (@ignored_types) {
 }
 
 # TODO document?
-# used to put a node name in error messages.
-sub node_extra_to_texi($)
+sub link_element_to_texi($)
 {
-  my $node = shift;
+  my $element = shift;
   my $result = '';
-  if ($node->{'manual_content'}) {
+  return $result if (!$element->{'extra'});
+  if ($element->{'extra'}->{'manual_content'}) {
     $result = '('.convert_to_texinfo({'contents'
-                              => $node->{'manual_content'}}) .')';
+                         => $element->{'extra'}->{'manual_content'}}) .')';
   }
-  if ($node->{'node_content'}) {
-    $result .= convert_to_texinfo({'contents' => $node->{'node_content'}});
+  if ($element->{'extra'}->{'node_content'}) {
+    $result .= convert_to_texinfo({'contents'
+                         => $element->{'extra'}->{'node_content'}});
   }
-  return $result;
+  return $result
 }
 
 # TODO document?
 sub target_element_to_texi_label($)
 {
   my $element = shift;
-  if ($element->{'extra'} and $element->{'extra'}->{'manual_content'}) {
-    return node_extra_to_texi($element->{'extra'});
-  }
   my $label_element = Texinfo::Common::get_label_element($element);
   return convert_to_texinfo({'contents' => $label_element->{'contents'}});
 }
@@ -234,7 +232,7 @@ Texinfo::Convert::Texinfo - Convert a Texinfo tree to 
Texinfo code
 =head1 SYNOPSIS
 
   use Texinfo::Convert::Texinfo qw(convert_to_texinfo);
-  
+
   my $texinfo_text = convert_to_texinfo($tree);
 
 =head1 NOTES
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index f9b2406772..640f9b0121 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -3483,7 +3483,7 @@ sub _end_line_misc_line($$$)
     }
     my $node_label_manual_info = _parse_node_manual($current->{'args'}->[0]);
     _check_internal_node($self, $node_label_manual_info,
-                         $source_info);
+                         $current, $source_info);
     Texinfo::Common::register_label($self->{'targets'}, $current);
     if ($self->{'current_part'}) {
       my $part = $self->{'current_part'};
@@ -3856,7 +3856,7 @@ sub _end_line_starting_block($$$)
     my $float_label;
     if ($current->{'args'} and $current->{'args'}->[1]) {
       $float_label = _parse_node_manual($current->{'args'}->[1]);
-      _check_internal_node($self, $float_label, $source_info);
+      _check_internal_node($self, $float_label, $current, $source_info);
     }
     # for now done in Texinfo::Convert::NodeNameNormalization, but could be
     # good to do in Parser/XS
@@ -4362,37 +4362,17 @@ sub _start_empty_line_after_command($$$) {
   return $line;
 }
 
-sub _check_empty_node($$$$)
-{
-  my ($self, $parsed_node, $command, $source_info) = @_;
-
-  if (!defined($parsed_node) or !$parsed_node->{'node_content'}) {
-    $self->_line_error(sprintf(__("empty argument in \@%s"),
-                $command), $source_info);
-    return 0;
-  } else {
-    return 1;
-  }
-}
-
-sub _check_internal_node($$$)
+sub _check_internal_node($$$$)
 {
-  my ($self, $parsed_node, $source_info) = @_;
+  my ($self, $label_info, $target_element, $source_info) = @_;
 
-  if ($parsed_node and $parsed_node->{'manual_content'}) {
+  if ($label_info and $label_info->{'manual_content'}) {
     $self->_line_error(sprintf(__("syntax for an external node used for `%s'"),
-        Texinfo::Convert::Texinfo::node_extra_to_texi($parsed_node)), 
$source_info);
+        
Texinfo::Convert::Texinfo::target_element_to_texi_label($target_element)),
+                       $source_info);
   }
 }
 
-sub _check_node_label($$$$)
-{
-  my ($self, $parsed_node, $command, $source_info) = @_;
-
-  _check_internal_node($self, $parsed_node, $source_info);
-  return _check_empty_node($self, $parsed_node, $command, $source_info);
-}
-
 # Return 1 if an element is all whitespace.
 # Note that this function isn't completely reliable because it
 # doesn't look deep into the element tree.
@@ -6295,18 +6275,23 @@ sub _process_remaining_on_line($$$$)
         }
         if ($current->{'parent'}->{'cmdname'} eq 'anchor') {
           $current->{'parent'}->{'source_info'} = $source_info;
-          my $parsed_anchor = _parse_node_manual($current);
-          if (_check_node_label($self, $parsed_anchor,
-                            $current->{'parent'}->{'cmdname'}, $source_info)) {
+          if (! $current->{'contents'}) {
+            $self->_line_error(sprintf(__("empty argument in \@%s"),
+                               $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'});
-             # the @anchor element_region information is not used in converters
-             if ($self->{'nesting_context'}
-                 and $self->{'nesting_context'}->{'regions_stack'}
+            # the @anchor element_region information is not used in converters
+            if ($self->{'nesting_context'}
+                and $self->{'nesting_context'}->{'regions_stack'}
            and scalar(@{$self->{'nesting_context'}->{'regions_stack'}}) > 0) {
-                $current->{'extra'} = {} if (!$current->{'extra'});
-                $current->{'extra'}->{'element_region'}
-                  = $self->{'nesting_context'}->{'regions_stack'}->[-1];
+              $current->{'extra'} = {} if (!$current->{'extra'});
+              $current->{'extra'}->{'element_region'}
+                = $self->{'nesting_context'}->{'regions_stack'}->[-1];
             }
           }
         } elsif ($ref_commands{$current->{'parent'}->{'cmdname'}}) {
@@ -6329,16 +6314,19 @@ sub _process_remaining_on_line($$$$)
                  "command \@%s missing a node or external manual argument"),
                                     $closed_command), $source_info);
             } else {
-              my $arg = $ref->{'args'}->[0];
-              my $ref_label_info = _parse_node_manual($arg);
+              my $arg_label = $ref->{'args'}->[0];
+              my $ref_label_info = _parse_node_manual($arg_label);
               if (defined $ref_label_info) {
                 foreach my $label_info (keys(%$ref_label_info)) {
-                  $arg->{'extra'} = {} if (!$arg->{'extra'});
-                  $arg->{'extra'}->{$label_info} = 
[@{$ref_label_info->{$label_info}}];
+                  $arg_label->{'extra'} = {} if (!$arg_label->{'extra'});
+                  $arg_label->{'extra'}->{$label_info}
+                    = [@{$ref_label_info->{$label_info}}];
                 }
                 if ($closed_command ne 'inforef'
                     and !defined($args[3]) and !defined($args[4])
                     and !$ref_label_info->{'manual_content'}) {
+                  # we use the @*ref command here and not the label command
+                  # to have more information for messages
                   push @{$self->{'internal_references'}}, $ref;
                 }
               }
diff --git a/tp/Texinfo/Structuring.pm b/tp/Texinfo/Structuring.pm
index e0fa54bee9..6f468ea692 100644
--- a/tp/Texinfo/Structuring.pm
+++ b/tp/Texinfo/Structuring.pm
@@ -40,7 +40,8 @@ use Texinfo::Commands;
 use Texinfo::Common;
 
 # for error messages
-use Texinfo::Convert::Texinfo qw(node_extra_to_texi 
target_element_to_texi_label);
+use Texinfo::Convert::Texinfo qw(target_element_to_texi_label
+                                 link_element_to_texi);
 # for debugging.  Also for index entries sorting.
 use Texinfo::Convert::Text;
 # for internal references and misc uses
@@ -388,14 +389,14 @@ sub _check_menu_entry($$$$$$)
       $registrar->line_error($customization_information,
                   sprintf(__("\@%s reference to nonexistent node `%s'"),
                           $command,
-                          node_extra_to_texi($menu_entry_node->{'extra'})),
+                          link_element_to_texi($menu_entry_node)),
                             $menu_content->{'source_info'});
     } else {
       if (!_check_node_same_texinfo_code($menu_node, 
$menu_entry_node->{'extra'})) {
         $registrar->line_warn($customization_information,
         sprintf(__("\@%s entry node name `%s' different from %s name `%s'"),
                 $command,
-                node_extra_to_texi($menu_entry_node->{'extra'}),
+                link_element_to_texi($menu_entry_node),
                 $menu_node->{'cmdname'},
                 target_element_to_texi_label($menu_node)),
                                $menu_content->{'source_info'});
@@ -856,9 +857,9 @@ sub nodes_tree($$$$$)
       }
     } else { # explicit directions
       for (my $i = 1; $i < scalar(@{$node->{'args'}}); $i++) {
-        my $arg = $node->{'args'}->[$i];
-        next if (!$arg->{'extra'});
-        my $node_direction = $arg->{'extra'};
+        my $direction_element = $node->{'args'}->[$i];
+        next if (!$direction_element->{'extra'});
+        my $node_direction = $direction_element->{'extra'};
         my $direction = $node_directions[$i-1];
 
         $node->{'structure'} = {} if (! defined($node->{'structure'}));
@@ -879,7 +880,7 @@ sub nodes_tree($$$$$)
                 sprintf(
              __("%s pointer `%s' (for node `%s') different from %s name `%s'"),
                   $direction_texts{$direction},
-                  node_extra_to_texi($node_direction),
+                  link_element_to_texi($direction_element),
                   target_element_to_texi_label($node),
                                      $node_target->{'cmdname'},
                   target_element_to_texi_label($node_target)),
@@ -893,7 +894,7 @@ sub nodes_tree($$$$$)
               $registrar->line_error($customization_information,
                    sprintf(__("%s reference to nonexistent `%s'"),
                       $direction_texts{$direction},
-                      node_extra_to_texi($node_direction)),
+                      link_element_to_texi($direction_element)),
                    $node->{'source_info'});
             }
           }
@@ -1485,45 +1486,47 @@ sub associate_internal_references($$$$$)
 
   return if (!defined($refs));
   foreach my $ref (@$refs) {
-    my $node_arg;
+    my $label_element;
     if ($ref->{'type'} and $ref->{'type'} eq 'menu_entry_node') {
-      if ($ref->{'extra'} and $ref->{'extra'}->{'node_content'}) {
-        my $normalized =
-          Texinfo::Convert::NodeNameNormalization::normalize_node(
-            {'contents' => $ref->{'extra'}->{'node_content'} });
-        $ref->{'extra'}->{'normalized'} = $normalized
-          if (defined $normalized and $normalized ne '');
-      }
-      next;
+      $label_element = $ref;
+    } else {
+      $label_element = $ref->{'args'}->[0];
     }
 
-    $node_arg = $ref->{'args'}->[0]->{'extra'}
-       if ($ref->{'args'} and scalar(@{$ref->{'args'}})
-           and $ref->{'args'}->[0]->{'extra'});
-    if ($node_arg and $node_arg->{'node_content'}) {
+    if ($label_element->{'extra'}
+        and $label_element->{'extra'}->{'node_content'}) {
       my $normalized =
-           Texinfo::Convert::NodeNameNormalization::normalize_node(
-              {'contents' => $node_arg->{'node_content'} });
-      $node_arg->{'normalized'} = $normalized;
+        Texinfo::Convert::NodeNameNormalization::normalize_node(
+            {'contents' => $label_element->{'extra'}->{'node_content'} });
+        $label_element->{'extra'}->{'normalized'} = $normalized
+          if (defined $normalized and $normalized ne '');
+    }
 
-      if (!defined($labels->{$node_arg->{'normalized'}})) {
+    if ($ref->{'type'} and $ref->{'type'} eq 'menu_entry_node') {
+      # similar messages are output in _check_menu_entry
+      next;
+    } elsif ($label_element->{'extra'}) {
+      my $label_info = $label_element->{'extra'};
+      if (!defined($label_info->{'normalized'})
+          or !defined($labels->{$label_info->{'normalized'}})) {
         if (!$customization_information->get_conf('novalidate')) {
           $registrar->line_error($customization_information,
-              sprintf(__("\@%s reference to nonexistent node `%s'"),
-                  $ref->{'cmdname'}, node_extra_to_texi($node_arg)),
-                  $ref->{'source_info'});
+                     sprintf(__("\@%s reference to nonexistent node `%s'"),
+                             $ref->{'cmdname'},
+                             link_element_to_texi($label_element)),
+                                 $ref->{'source_info'});
         }
       } else {
-        my $node_target = $labels->{$node_arg->{'normalized'}};
+        my $node_target = $labels->{$label_info->{'normalized'}};
         if (!$customization_information->get_conf('novalidate')
-            and !_check_node_same_texinfo_code($node_target, $node_arg)) {
+            and !_check_node_same_texinfo_code($node_target, $label_info)) {
           $registrar->line_warn($customization_information,
              sprintf(__("\@%s to `%s', different from %s name `%s'"),
-                 $ref->{'cmdname'},
-                 node_extra_to_texi($node_arg),
-                 $node_target->{'cmdname'},
-                 target_element_to_texi_label($node_target)),
-             $ref->{'source_info'});
+                     $ref->{'cmdname'},
+                     link_element_to_texi($label_element),
+                     $node_target->{'cmdname'},
+                     target_element_to_texi_label($node_target)),
+                                $ref->{'source_info'});
         }
       }
     }
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 14e96fccd4..6b93757474 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -41,27 +41,6 @@ check_internal_node (NODE_SPEC_EXTRA *nse)
     }
 }
 
-int
-check_empty_node (NODE_SPEC_EXTRA *nse,
-                  enum command_id cmd)
-{
-  if (!nse || !nse->node_content || nse->node_content->contents.number == 0)
-    {
-      line_error ("empty argument in @%s", command_name(cmd));
-      return 0;
-    }
-  else
-    return 1;
-}
-
-int
-check_node_label (NODE_SPEC_EXTRA *nse,
-                  enum command_id cmd)
-{
-  check_internal_node (nse);
-  return check_empty_node (nse, cmd);
-}
-
 static int
 is_decimal_number (char *string)
 {
diff --git a/tp/Texinfo/XS/parsetexi/parser.h b/tp/Texinfo/XS/parsetexi/parser.h
index 8954db2a5a..bb13077529 100644
--- a/tp/Texinfo/XS/parsetexi/parser.h
+++ b/tp/Texinfo/XS/parsetexi/parser.h
@@ -133,7 +133,7 @@ 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);
-int check_node_label (NODE_SPEC_EXTRA *nse, enum command_id cmd);
+void check_internal_node (NODE_SPEC_EXTRA *nse);
 
 typedef struct {
     char *type;
diff --git a/tp/Texinfo/XS/parsetexi/separator.c 
b/tp/Texinfo/XS/parsetexi/separator.c
index 60714f31ad..87fae84061 100644
--- a/tp/Texinfo/XS/parsetexi/separator.c
+++ b/tp/Texinfo/XS/parsetexi/separator.c
@@ -266,11 +266,20 @@ handle_close_brace (ELEMENT *current, char **line_inout)
 
       if (closed_command == CM_anchor)
         {
-          NODE_SPEC_EXTRA *parsed_anchor;
           current->parent->source_info = current_source_info;
-          parsed_anchor = parse_node_manual (current);
-          if (check_node_label (parsed_anchor, CM_anchor))
+          if (current->contents.number == 0)
+            line_error ("empty argument in @%s",
+                        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);
               if (nesting_context.regions_stack.top > 0)
                 {
@@ -278,11 +287,6 @@ handle_close_brace (ELEMENT *current, char **line_inout)
                     command_name(top_command(&nesting_context.regions_stack)));
                 }
             }
-          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);
         }
       else if (command_data(closed_command).flags & CF_ref)
         {
@@ -307,17 +311,17 @@ handle_close_brace (ELEMENT *current, char **line_inout)
                 }
               else
                 {
-                  ELEMENT *arg = args_child_by_index (ref, 0);
-                  NODE_SPEC_EXTRA *ref_label_info = parse_node_manual (arg);
+                  ELEMENT *arg_label = args_child_by_index (ref, 0);
+                  NODE_SPEC_EXTRA *ref_label_info = parse_node_manual 
(arg_label);
 
                   if (ref_label_info && (ref_label_info->manual_content
                                          || ref_label_info->node_content))
                     {
                       if (ref_label_info->node_content)
-                        add_extra_contents (arg, "node_content",
+                        add_extra_contents (arg_label, "node_content",
                                             ref_label_info->node_content);
                       if (ref_label_info->manual_content)
-                        add_extra_contents (arg, "manual_content",
+                        add_extra_contents (arg_label, "manual_content",
                                             ref_label_info->manual_content);
                     }
                   else
@@ -335,6 +339,8 @@ handle_close_brace (ELEMENT *current, char **line_inout)
                                && ref->args.list[4]->contents.number == 0))
                       && !ref_label_info->manual_content)
                     {
+                      /* we use the @*ref command here and not the label 
command
+                         to have more information for messages */
                       remember_internal_xref (ref);
                     }
                   free (ref_label_info);
diff --git a/tp/t/results/info_tests/novalidate_empty_refs.pl 
b/tp/t/results/info_tests/novalidate_empty_refs.pl
index 83b7a38176..418c567603 100644
--- a/tp/t/results/info_tests/novalidate_empty_refs.pl
+++ b/tp/t/results/info_tests/novalidate_empty_refs.pl
@@ -74,8 +74,7 @@ $result_trees{'novalidate_empty_refs'} = {
                   'extra' => {
                     'node_content' => [
                       {}
-                    ],
-                    'normalized' => ''
+                    ]
                   },
                   'type' => 'brace_command_arg'
                 }
diff --git a/tp/t/results/sectioning/empty_refs.pl 
b/tp/t/results/sectioning/empty_refs.pl
index 9918a6d5e4..a51df54297 100644
--- a/tp/t/results/sectioning/empty_refs.pl
+++ b/tp/t/results/sectioning/empty_refs.pl
@@ -22,8 +22,7 @@ $result_trees{'empty_refs'} = {
                   'extra' => {
                     'node_content' => [
                       {}
-                    ],
-                    'normalized' => ''
+                    ]
                   },
                   'type' => 'brace_command_arg'
                 }



reply via email to

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