texinfo-commits
[Top][All Lists]
Advanced

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

[7469] nodes_tree


From: gavinsmith0123
Subject: [7469] nodes_tree
Date: Sun, 23 Oct 2016 16:20:23 +0000 (UTC)

Revision: 7469
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7469
Author:   gavin
Date:     2016-10-23 16:20:22 +0000 (Sun, 23 Oct 2016)
Log Message:
-----------
nodes_tree

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Structuring.pm
    trunk/tp/t/results/sectioning/character_and_spaces_in_node.pl
    trunk/tp/t/results/sectioning/loop_nodes.pl
    trunk/tp/t/results/sectioning/menutextorder.pl
    trunk/tp/t/results/sectioning/no_menu.pl
    trunk/tp/t/results/sectioning/section_chapter_before_top_nodes.pl

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-10-23 15:18:13 UTC (rev 7468)
+++ trunk/ChangeLog     2016-10-23 16:20:22 UTC (rev 7469)
@@ -1,5 +1,14 @@
 2016-10-23  Gavin Smith  <address@hidden>
 
+       * tp/Texinfo/Structuring.pm (nodes_tree): If 'validatemenus' is 
+       not on, do not complain about a node lacking a menu item if that 
+       node has no menu at all.  If 'validatemenus' is not on, in order 
+       to complain about the menu structure not matching the section 
+       structure, the nodes must be associated with sections and 
+       contain menus.  Some comments changed.
+
+2016-10-23  Gavin Smith  <address@hidden>
+
        * tp/Texinfo/Structuring.pm (nodes_tree): Only check whether 
        node is in a menu if 'validatemenus' is on.
 

Modified: trunk/tp/Texinfo/Structuring.pm
===================================================================
--- trunk/tp/Texinfo/Structuring.pm     2016-10-23 15:18:13 UTC (rev 7468)
+++ trunk/tp/Texinfo/Structuring.pm     2016-10-23 16:20:22 UTC (rev 7469)
@@ -622,11 +622,13 @@
           }
           if ($node->{'extra'}->{'associated_section'}) {
             my $section = $node->{'extra'}->{'associated_section'};
-            # prefer the section associated to the part for node directions.
+
+            # Prefer the section associated with a @part for node directions.
             if ($section->{'extra'}->{'part_associated_section'}) {
               $section = $section->{'extra'}->{'part_associated_section'};
             }
-            # use toplevel to go through parts.  But not for @top as prev
+            # Set node_$direction, usually from section_$direction.
+            # 'toplevel' is to go through parts, except for @top as prev
             # or next.
             foreach my $direction_base ('section', 'toplevel') {
               if ($section->{$direction_base.'_'.$direction}
@@ -640,18 +642,31 @@
                 last;
               }
             }
-            # if set, a direction was found using sections.  Check consistency
-            # with menu before going to the next direction
+            # If set, a direction was found using sections.  Check consistency
+            # with menus.
             if ($node->{'node_'.$direction}) {
               if ($self->{'SHOW_MENU'}) {
-                if (!$node->{'menu_'.$direction}) {
+
+                if (($node->{'extra'}
+            and $node->{'extra'}{'associated_section'}
+            and $node->{'extra'}{'associated_section'}{'section_up'}{'extra'}
+            and $node->{'extra'}{'associated_section'}{'section_up'}{'extra'}
+                       {'associated_node'}
+            and $node->{'extra'}{'associated_section'}{'section_up'}{'extra'}
+                       {'associated_node'}{'menus'}
+            and @{$node->{'extra'}{'associated_section'}{'section_up'}{'extra'}
+                         {'associated_node'}{'menus'}}
+                     or $self->{'validatemenus'})
+                    and !$node->{'menu_'.$direction}) {
                   $self->line_warn(sprintf($self->
-                    __("node `%s' is %s for `%s' in sectioning but not in 
menu"), 
-                  node_extra_to_texi($node->{'node_'.$direction}->{'extra'}), 
-                  $direction,
-                  node_extra_to_texi($node->{'extra'})),
-                  $node->{'line_nr'});
-                } elsif ($node->{'menu_'.$direction} ne 
$node->{'node_'.$direction}) {
+               __("node `%s' is %s for `%s' in sectioning but not in menu"), 
+                    
node_extra_to_texi($node->{'node_'.$direction}->{'extra'}), 
+                                       $direction,
+                    node_extra_to_texi($node->{'extra'})),
+                                       $node->{'line_nr'});
+                } elsif ($node->{'menu_'.$direction}
+                         and $node->{'menu_'.$direction}
+                             ne $node->{'node_'.$direction}) {
                   $self->line_warn(sprintf($self->
                     __("node %s `%s' in menu `%s' and in sectioning `%s' 
differ"), 
                     $direction,
@@ -766,7 +781,9 @@
         and ($node->{'node_up'}->{'extra'}->{'manual_content'}
          or !$node->{'menu_up_hash'}
          or 
!$node->{'menu_up_hash'}->{$node->{'node_up'}->{'extra'}->{'normalized'}})) {
-      if (!$node->{'node_up'}->{'extra'}->{'manual_content'}) {
+      if (($node->{'node_up'}->{'menus'} and @{$node->{'node_up'}->{'menus'}}
+           or $self->{'validatemenus'})
+          and !$node->{'node_up'}->{'extra'}->{'manual_content'}) {
       # 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"), 

Modified: trunk/tp/t/results/sectioning/character_and_spaces_in_node.pl
===================================================================
--- trunk/tp/t/results/sectioning/character_and_spaces_in_node.pl       
2016-10-23 15:18:13 UTC (rev 7468)
+++ trunk/tp/t/results/sectioning/character_and_spaces_in_node.pl       
2016-10-23 16:20:22 UTC (rev 7469)
@@ -613,44 +613,7 @@
   }
 };
 
-$result_errors{'character_and_spaces_in_node'} = [
-  {
-    'error_line' => ':2: node `Top\' lacks menu item for `other nodes\' 
despite being its Up target
-',
-    'file_name' => '',
-    'line_nr' => 2,
-    'macro' => '',
-    'text' => 'node `Top\' lacks menu item for `other nodes\' despite being 
its Up target',
-    'type' => 'error'
-  },
-  {
-    'error_line' => ':3: node `other nodes\' lacks menu item for 
`!_"#$%&\'()*+-.\' despite being its Up target
-',
-    'file_name' => '',
-    'line_nr' => 3,
-    'macro' => '',
-    'text' => 'node `other nodes\' lacks menu item for `!_"#$%&\'()*+-.\' 
despite being its Up target',
-    'type' => 'error'
-  },
-  {
-    'error_line' => ':3: node `other nodes\' lacks menu item for 
`/;<=>?[\\]^_`|~\' despite being its Up target
-',
-    'file_name' => '',
-    'line_nr' => 3,
-    'macro' => '',
-    'text' => 'node `other nodes\' lacks menu item for `/;<=>?[\\]^_`|~\' 
despite being its Up target',
-    'type' => 'error'
-  },
-  {
-    'error_line' => ':3: node `other nodes\' lacks menu item for `local   
node\' despite being its Up target
-',
-    'file_name' => '',
-    'line_nr' => 3,
-    'macro' => '',
-    'text' => 'node `other nodes\' lacks menu item for `local   node\' despite 
being its Up target',
-    'type' => 'error'
-  }
-];
+$result_errors{'character_and_spaces_in_node'} = [];
 
 
 

Modified: trunk/tp/t/results/sectioning/loop_nodes.pl
===================================================================
--- trunk/tp/t/results/sectioning/loop_nodes.pl 2016-10-23 15:18:13 UTC (rev 
7468)
+++ trunk/tp/t/results/sectioning/loop_nodes.pl 2016-10-23 16:20:22 UTC (rev 
7469)
@@ -1054,13 +1054,13 @@
 
 $result_errors{'loop_nodes'} = [
   {
-    'error_line' => ':21: node `node down\' lacks menu item for `node up\' 
despite being its Up target
+    'error_line' => ':9: warning: for `node up\', up in menu `Top\' and up 
`node down\' don\'t match
 ',
     'file_name' => '',
-    'line_nr' => 21,
+    'line_nr' => 9,
     'macro' => '',
-    'text' => 'node `node down\' lacks menu item for `node up\' despite being 
its Up target',
-    'type' => 'error'
+    'text' => 'for `node up\', up in menu `Top\' and up `node down\' don\'t 
match',
+    'type' => 'warning'
   }
 ];
 

Modified: trunk/tp/t/results/sectioning/menutextorder.pl
===================================================================
--- trunk/tp/t/results/sectioning/menutextorder.pl      2016-10-23 15:18:13 UTC 
(rev 7468)
+++ trunk/tp/t/results/sectioning/menutextorder.pl      2016-10-23 16:20:22 UTC 
(rev 7469)
@@ -1871,15 +1871,6 @@
     'type' => 'error'
   },
   {
-    'error_line' => ':6: warning: node `foo\' is next for `bar\' in sectioning 
but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 6,
-    'macro' => '',
-    'text' => 'node `foo\' is next for `bar\' in sectioning but not in menu',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':13: warning: node `onesub2\' is next for `onesub1\' in 
sectioning but not in menu
 ',
     'file_name' => '',
@@ -1916,15 +1907,6 @@
     'type' => 'warning'
   },
   {
-    'error_line' => ':20: warning: node `bar\' is prev for `foo\' in 
sectioning but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 20,
-    'macro' => '',
-    'text' => 'node `bar\' is prev for `foo\' in sectioning but not in menu',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':29: warning: node next `sub1\' in menu `sub3\' and in 
sectioning `sub2\' differ
 ',
     'file_name' => '',

Modified: trunk/tp/t/results/sectioning/no_menu.pl
===================================================================
--- trunk/tp/t/results/sectioning/no_menu.pl    2016-10-23 15:18:13 UTC (rev 
7468)
+++ trunk/tp/t/results/sectioning/no_menu.pl    2016-10-23 16:20:22 UTC (rev 
7469)
@@ -605,98 +605,7 @@
   }
 };
 
-$result_errors{'no_menu'} = [
-  {
-    'error_line' => ':4: warning: node `c2\' is next for `c1\' in sectioning 
but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 4,
-    'macro' => '',
-    'text' => 'node `c2\' is next for `c1\' in sectioning but not in menu',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':4: warning: node `Top\' is up for `c1\' in sectioning 
but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 4,
-    'macro' => '',
-    'text' => 'node `Top\' is up for `c1\' in sectioning but not in menu',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':1: node `Top\' lacks menu item for `c1\' despite being 
its Up target
-',
-    'file_name' => '',
-    'line_nr' => 1,
-    'macro' => '',
-    'text' => 'node `Top\' lacks menu item for `c1\' despite being its Up 
target',
-    'type' => 'error'
-  },
-  {
-    'error_line' => ':7: warning: node `c3\' is next for `c2\' in sectioning 
but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 7,
-    'macro' => '',
-    'text' => 'node `c3\' is next for `c2\' in sectioning but not in menu',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':7: warning: node `c1\' is prev for `c2\' in sectioning 
but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 7,
-    'macro' => '',
-    'text' => 'node `c1\' is prev for `c2\' in sectioning but not in menu',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':7: warning: node `Top\' is up for `c2\' in sectioning 
but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 7,
-    'macro' => '',
-    'text' => 'node `Top\' is up for `c2\' in sectioning but not in menu',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':1: node `Top\' lacks menu item for `c2\' despite being 
its Up target
-',
-    'file_name' => '',
-    'line_nr' => 1,
-    'macro' => '',
-    'text' => 'node `Top\' lacks menu item for `c2\' despite being its Up 
target',
-    'type' => 'error'
-  },
-  {
-    'error_line' => ':10: warning: node `c2\' is prev for `c3\' in sectioning 
but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 10,
-    'macro' => '',
-    'text' => 'node `c2\' is prev for `c3\' in sectioning but not in menu',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':10: warning: node `Top\' is up for `c3\' in sectioning 
but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 10,
-    'macro' => '',
-    'text' => 'node `Top\' is up for `c3\' in sectioning but not in menu',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':1: node `Top\' lacks menu item for `c3\' despite being 
its Up target
-',
-    'file_name' => '',
-    'line_nr' => 1,
-    'macro' => '',
-    'text' => 'node `Top\' lacks menu item for `c3\' despite being its Up 
target',
-    'type' => 'error'
-  }
-];
+$result_errors{'no_menu'} = [];
 
 
 

Modified: trunk/tp/t/results/sectioning/section_chapter_before_top_nodes.pl
===================================================================
--- trunk/tp/t/results/sectioning/section_chapter_before_top_nodes.pl   
2016-10-23 15:18:13 UTC (rev 7468)
+++ trunk/tp/t/results/sectioning/section_chapter_before_top_nodes.pl   
2016-10-23 16:20:22 UTC (rev 7469)
@@ -908,15 +908,6 @@
     'type' => 'warning'
   },
   {
-    'error_line' => ':1: warning: node `chapter node\' is next for `section 
node\' in sectioning but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 1,
-    'macro' => '',
-    'text' => 'node `chapter node\' is next for `section node\' in sectioning 
but not in menu',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':1: warning: node `chapter node\' is up for `section 
node\' in menu but not in sectioning
 ',
     'file_name' => '',
@@ -926,24 +917,6 @@
     'type' => 'warning'
   },
   {
-    'error_line' => ':4: warning: node `Top\' is next for `chapter node\' in 
sectioning but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 4,
-    'macro' => '',
-    'text' => 'node `Top\' is next for `chapter node\' in sectioning but not 
in menu',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => ':4: warning: node `section node\' is prev for `chapter 
node\' in sectioning but not in menu
-',
-    'file_name' => '',
-    'line_nr' => 4,
-    'macro' => '',
-    'text' => 'node `section node\' is prev for `chapter node\' in sectioning 
but not in menu',
-    'type' => 'warning'
-  },
-  {
     'error_line' => ':4: warning: node `Top\' is up for `chapter node\' in 
menu but not in sectioning
 ',
     'file_name' => '',




reply via email to

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