texinfo-commits
[Top][All Lists]
Advanced

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

[7080] move _node_extra_to_texi between files


From: Gavin D. Smith
Subject: [7080] move _node_extra_to_texi between files
Date: Mon, 28 Mar 2016 14:52:43 +0000

Revision: 7080
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7080
Author:   gavin
Date:     2016-03-28 14:52:42 +0000 (Mon, 28 Mar 2016)
Log Message:
-----------
move _node_extra_to_texi between files

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Convert/Texinfo.pm
    trunk/tp/Texinfo/Parser.pm
    trunk/tp/Texinfo/Structuring.pm

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-03-28 14:09:37 UTC (rev 7079)
+++ trunk/ChangeLog     2016-03-28 14:52:42 UTC (rev 7080)
@@ -1,5 +1,10 @@
 2016-03-28  Gavin Smith  <address@hidden>
 
+       * tp/Texinfo/Parser.pm (_node_extra_to_texi): Move to 
+       tp/Texinfo/Convert/Texinfo.pm and rename 'node_extra_to_texi'.
+
+2016-03-28  Gavin Smith  <address@hidden>
+
        * tp/Texinfo/Parser.pm (_abort_empty_line): Check if 
        'spaces_before_argument' extra value needs to be removed from 
        parent as well as from current element.

Modified: trunk/tp/Texinfo/Convert/Texinfo.pm
===================================================================
--- trunk/tp/Texinfo/Convert/Texinfo.pm 2016-03-28 14:09:37 UTC (rev 7079)
+++ trunk/tp/Texinfo/Convert/Texinfo.pm 2016-03-28 14:52:42 UTC (rev 7080)
@@ -1,6 +1,6 @@
 # Texinfo.pm: output a Texinfo tree as Texinfo.
 #
-# Copyright 2010, 2011, 2012 Free Software Foundation, Inc.
+# Copyright 2010, 2011, 2012, 2016 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
@@ -39,6 +39,7 @@
 # will save memory.
 %EXPORT_TAGS = ( 'all' => [ qw(
   convert
+  node_extra_to_texi
 ) ] );
 
 @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
@@ -105,7 +106,23 @@
   return $result;
 }
 
+# used to put a node name in error messages.
+sub node_extra_to_texi($)
+{
+  my $node = shift;
+  my $result = '';
+  if ($node->{'manual_content'}) {
+    $result = '('.Texinfo::Convert::Texinfo::convert({'contents'
+                                     => $node->{'manual_content'}}) .')';
+  }
+  if ($node->{'node_content'}) {
+    $result .= Texinfo::Convert::Texinfo::convert ({'contents'
+                                          => $node->{'node_content'}});
+  }
+  return $result;
+}
 
+
 # expand a command argument as texinfo.
 sub _expand_cmd_args_to_texi ($;$) {
   my $cmd = shift;

Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm  2016-03-28 14:09:37 UTC (rev 7079)
+++ trunk/tp/Texinfo/Parser.pm  2016-03-28 14:52:42 UTC (rev 7080)
@@ -2276,22 +2276,6 @@
   }
 }
 
-# used to put a node name in error messages.
-sub _node_extra_to_texi($)
-{
-  my $node = shift;
-  my $result = '';
-  if ($node->{'manual_content'}) {
-    $result = '('.Texinfo::Convert::Texinfo::convert({'contents'
-                                     => $node->{'manual_content'}}) .')';
-  }
-  if ($node->{'node_content'}) {
-    $result .= Texinfo::Convert::Texinfo::convert ({'contents'
-                                          => $node->{'node_content'}});
-  }
-  return $result;
-}
-
 sub _find_end_brace($$)
 {
   my $text = shift;
@@ -3702,7 +3686,7 @@
   my $line_nr = shift;
   if ($parsed_node and $parsed_node->{'manual_content'}) {
     $self->line_error (sprintf($self->__("syntax for an external node used for 
`%s'"),
-          _node_extra_to_texi($parsed_node)), $line_nr)
+          Texinfo::Structuring::node_extra_to_texi($parsed_node)), $line_nr)
   }
 }
 

Modified: trunk/tp/Texinfo/Structuring.pm
===================================================================
--- trunk/tp/Texinfo/Structuring.pm     2016-03-28 14:09:37 UTC (rev 7079)
+++ trunk/tp/Texinfo/Structuring.pm     2016-03-28 14:52:42 UTC (rev 7080)
@@ -29,6 +29,8 @@
 # for error messages 
 use Texinfo::Convert::Texinfo;
 
+*node_extra_to_texi = \&Texinfo::Convert::Texinfo::node_extra_to_texi;
+
 use Carp qw(cluck);
 
 require Exporter;
@@ -541,11 +543,9 @@
   if 
(!$self->{'labels'}->{$menu_content->{'extra'}->{'menu_entry_node'}->{'normalized'}})
 {
     if ($check_menu_entries) {
       $self->line_error(sprintf($self->
-       __("address@hidden reference to nonexistent node `%s'"), 
-         $command,
-         Texinfo::Parser::_node_extra_to_texi(
-                 $menu_content->{'extra'}->{'menu_entry_node'})), 
-        $menu_content->{'line_nr'});
+       __("address@hidden reference to nonexistent node `%s'"), $command,
+          node_extra_to_texi($menu_content->{'extra'}->{'menu_entry_node'})), 
+       $menu_content->{'line_nr'});
     }
   } else {
     my $normalized_menu_node
@@ -556,11 +556,10 @@
       $self->line_warn(sprintf($self->
        __("address@hidden entry node name `%s' different from %s name `%s'"), 
          $command,
-         Texinfo::Parser::_node_extra_to_texi(
-                 $menu_content->{'extra'}->{'menu_entry_node'}),
+         node_extra_to_texi($menu_content->{'extra'}->{'menu_entry_node'}),
          $menu_node->{'cmdname'},
-         Texinfo::Parser::_node_extra_to_texi($menu_node->{'extra'})),
-        $menu_content->{'line_nr'});
+         node_extra_to_texi($menu_node->{'extra'})),
+                            $menu_content->{'line_nr'});
     }
   }
   return $menu_node;
@@ -660,11 +659,8 @@
     # warn if node is not top node and doesn't appear in menu
     if ($self->{'SHOW_MENU'} and $node ne $top_node and !$node->{'menu_up'}) {
       $self->line_warn(sprintf($self->__("unreferenced node `%s'"), 
-                    Texinfo::Parser::_node_extra_to_texi($node->{'extra'})), 
-                       $node->{'line_nr'});
+                    node_extra_to_texi($node->{'extra'})), $node->{'line_nr'});
     }
-    #print STDERR "Processing "
-    #  .Texinfo::Parser::_node_extra_to_texi($node->{'extra'})."\n";
    
     my $automatic_directions = 
       (scalar(@{$node->{'extra'}->{'nodes_manuals'}}) == 1);
@@ -706,17 +702,17 @@
                 if (!$node->{'menu_'.$direction}) {
                   $self->line_warn(sprintf($self->
                     __("node `%s' is %s for `%s' in sectioning but not in 
menu"), 
-                  
Texinfo::Parser::_node_extra_to_texi($node->{'node_'.$direction}->{'extra'}), 
+                  node_extra_to_texi($node->{'node_'.$direction}->{'extra'}), 
                   $direction,
-                  Texinfo::Parser::_node_extra_to_texi($node->{'extra'})),
+                  node_extra_to_texi($node->{'extra'})),
                   $node->{'line_nr'});
                 } elsif ($node->{'menu_'.$direction} ne 
$node->{'node_'.$direction}) {
                   $self->line_warn(sprintf($self->
                     __("node %s `%s' in menu `%s' and in sectioning `%s' 
differ"), 
                     $direction,
-                    Texinfo::Parser::_node_extra_to_texi($node->{'extra'}),
-                    
Texinfo::Parser::_node_extra_to_texi($node->{'menu_'.$direction}->{'extra'}), 
-                    
Texinfo::Parser::_node_extra_to_texi($node->{'node_'.$direction}->{'extra'})),
+                    node_extra_to_texi($node->{'extra'}),
+                    
node_extra_to_texi($node->{'menu_'.$direction}->{'extra'}), 
+                    
node_extra_to_texi($node->{'node_'.$direction}->{'extra'})),
                     $node->{'line_nr'});
                 }
               }
@@ -731,9 +727,9 @@
             if ($self->{'SHOW_MENU'} and 
$node->{'extra'}->{'associated_section'}) {
               $self->line_warn(sprintf($self->
                   __("node `%s' is %s for `%s' in menu but not in 
sectioning"), 
-                
Texinfo::Parser::_node_extra_to_texi($node->{'menu_'.$direction}->{'extra'}),
-                $direction,
-                Texinfo::Parser::_node_extra_to_texi($node->{'extra'}), 
+                node_extra_to_texi($node->{'menu_'.$direction}->{'extra'}),
+                                   $direction,
+                node_extra_to_texi($node->{'extra'}), 
                   ), 
                 $node->{'line_nr'});
             }
@@ -786,14 +782,11 @@
               $self->line_warn(sprintf($self->
                 __("%s pointer `%s' (for node `%s') different from %s name 
`%s'"),
                   $direction_texts{$direction},
-                  Texinfo::Parser::_node_extra_to_texi(
-                        $node_direction),
-                  Texinfo::Parser::_node_extra_to_texi(
-                        $node->{'extra'}),
-                  $node_target->{'cmdname'},
-                  Texinfo::Parser::_node_extra_to_texi(
-                        $node_target->{'extra'})),
-                $node->{'line_nr'});
+                  node_extra_to_texi($node_direction),
+                  node_extra_to_texi($node->{'extra'}),
+                                     $node_target->{'cmdname'},
+                  node_extra_to_texi($node_target->{'extra'})),
+                                     $node->{'line_nr'});
             }
           } else {
             if ($self->{'novalidate'}) {
@@ -813,8 +806,7 @@
               $self->line_error(sprintf($self->
                                   __("%s reference to nonexistent `%s'"),
                     $direction_texts{$direction},
-                    Texinfo::Parser::_node_extra_to_texi($node_direction)), 
-                    $node->{'line_nr'});
+                    node_extra_to_texi($node_direction)), $node->{'line_nr'});
             }
           }
         }
@@ -832,17 +824,17 @@
       # up node is a real node but has no menu entry
         $self->line_error(sprintf($self->
            __("node `%s' lacks menu item for `%s' despite being its Up 
target"), 
-           
Texinfo::Parser::_node_extra_to_texi($node->{'node_up'}->{'extra'}), 
-           Texinfo::Parser::_node_extra_to_texi($node->{'extra'})),
+           node_extra_to_texi($node->{'node_up'}->{'extra'}), 
+           node_extra_to_texi($node->{'extra'})),
            $node->{'node_up'}->{'line_nr'});
       # This leads to an error when there is an external nodes as up, and 
       # not in Top node.
       } elsif ($node->{'menu_up'}) {
         $self->line_warn(sprintf($self->
            __("for `%s', up in menu `%s' and up `%s' don't match"), 
-          Texinfo::Parser::_node_extra_to_texi($node->{'extra'}),
-          Texinfo::Parser::_node_extra_to_texi($node->{'menu_up'}->{'extra'}), 
-          Texinfo::Parser::_node_extra_to_texi($node->{'node_up'}->{'extra'})),
+          node_extra_to_texi($node->{'extra'}),
+          node_extra_to_texi($node->{'menu_up'}->{'extra'}), 
+          node_extra_to_texi($node->{'node_up'}->{'extra'})),
                         $node->{'line_nr'});
       }
     }
@@ -1326,9 +1318,8 @@
     if (!defined($labels->{$ref->{'extra'}->{'node_argument'}->{'normalized'}})
          and !$self->{'novalidate'}) {
       $self->line_error(sprintf($self->__("address@hidden reference to 
nonexistent node `%s'"),
-                           $ref->{'cmdname'}, 
-                           Texinfo::Parser::_node_extra_to_texi(
-                                $ref->{'extra'}->{'node_argument'})), 
+              $ref->{'cmdname'}, 
+              node_extra_to_texi($ref->{'extra'}->{'node_argument'})), 
                         $ref->{'line_nr'})
     } else {
       my $node_target 
@@ -1339,12 +1330,9 @@
         $self->line_warn(sprintf($self->
            __("address@hidden to `%s', different from %s name `%s'"), 
            $ref->{'cmdname'},
-           Texinfo::Parser::_node_extra_to_texi(
-              $ref->{'extra'}->{'node_argument'}),
+           node_extra_to_texi($ref->{'extra'}->{'node_argument'}),
            $node_target->{'cmdname'},
-           Texinfo::Parser::_node_extra_to_texi(
-                        $node_target->{'extra'})),
-          $ref->{'line_nr'});
+           node_extra_to_texi($node_target->{'extra'})), $ref->{'line_nr'});
       }
     }
   }




reply via email to

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