texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp Texinfo/Parser.pm Texinfo/Structurin...


From: Patrice Dumas
Subject: texinfo/tp Texinfo/Parser.pm Texinfo/Structurin...
Date: Sat, 30 Oct 2010 19:33:49 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        10/10/30 19:33:49

Modified files:
        tp/Texinfo     : Parser.pm Structuring.pm 
        tp/t/results/sectioning: character_and_spaces_in_node.pl node.pl 
                                 nodename_parentheses.pl 
        tp/t/results/value: value_node_directions.pl 

Log message:
        Handle novalidate.
        Warn for node unreferenced in menu.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.129&r2=1.130
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Structuring.pm?cvsroot=texinfo&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/character_and_spaces_in_node.pl?cvsroot=texinfo&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/node.pl?cvsroot=texinfo&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/nodename_parentheses.pl?cvsroot=texinfo&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/value/value_node_directions.pl?cvsroot=texinfo&r1=1.22&r2=1.23

Patches:
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -b -r1.129 -r1.130
--- Texinfo/Parser.pm   30 Oct 2010 18:31:49 -0000      1.129
+++ Texinfo/Parser.pm   30 Oct 2010 19:33:49 -0000      1.130
@@ -106,6 +106,7 @@
   'labels'          => {},  # keys are normalized label names, as described
                             # in the `HTML Xref' node.  Value should be
                             # a node/anchor or float in the tree.
+  'novalidate' => 0,        # same as setting @novalidate.
 );
 
 # the other possible keys for the parser state are:
@@ -2823,6 +2824,8 @@
               $self->{'sections_level'}++;
             } elsif ($command eq 'lowersections') {
               $self->{'sections_level'}--;
+            } elsif ($command eq 'novalidate') {
+              $self->{'novalidate'} = 1;
             }
             last NEXT_LINE if ($command eq 'bye');
             last;

Index: Texinfo/Structuring.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Structuring.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- Texinfo/Structuring.pm      30 Oct 2010 19:08:18 -0000      1.10
+++ Texinfo/Structuring.pm      30 Oct 2010 19:33:49 -0000      1.11
@@ -309,10 +309,11 @@
              and $menu_content->{'extra'}->{'menu_entry_node'}
              and 
!$menu_content->{'extra'}->{'menu_entry_node'}->{'manual_content'}) {
             if 
(!$self->{'labels'}->{$menu_content->{'extra'}->{'menu_entry_node'}->{'normalized'}})
 {
-              # FIXME novalidate
+              if (!$self->{'novalidate'}) {
               $self->_line_error (sprintf($self->__("Menu reference to 
nonexistent node `%s'"), 
                 tree_to_texi({ 'contents' => 
$menu_content->{'extra'}->{'menu_entry_node'}->{'node_content'} })), 
                 $menu_content->{'line_nr'});
+              }
             } else {
               my $menu_node =
                 
$self->{'labels'}->{$menu_content->{'extra'}->{'menu_entry_node'}->{'normalized'}};
@@ -331,6 +332,14 @@
     }
   }
   $top_node = $self->{'nodes'}->[0] if (!$top_node);
+  foreach my $node (@{$self->{'nodes'}}) {
+    # warn if node is not top node and doesn't appear in menu
+    if ($node ne $top_node and !$node->{'menu_up'}) {
+      $self->_line_warn (sprintf($self->__("unreferenced node `%s'"), 
+        tree_to_texi({ 'contents' => $node->{'extra'}->{'node_content'}})), 
+                       $node->{'line_nr'});
+    }
+  }
   return $top_node;
 }
 

Index: t/results/sectioning/character_and_spaces_in_node.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/sectioning/character_and_spaces_in_node.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- t/results/sectioning/character_and_spaces_in_node.pl        30 Oct 2010 
18:48:14 -0000      1.8
+++ t/results/sectioning/character_and_spaces_in_node.pl        30 Oct 2010 
19:33:49 -0000      1.9
@@ -536,7 +536,44 @@
 
 $result_sectioning{'character_and_spaces_in_node'} = {};
 
-$result_errors{'character_and_spaces_in_node'} = [];
+$result_errors{'character_and_spaces_in_node'} = [
+  {
+    'error_line' => ':3: warning: unreferenced node `other nodes\'
+',
+    'file_name' => '',
+    'line_nr' => 3,
+    'macro' => '',
+    'text' => 'unreferenced node `other nodes\'',
+    'type' => 'warning'
+  },
+  {
+    'error_line' => ':4: warning: unreferenced node `!_"#$%&\'()*+-.\'
+',
+    'file_name' => '',
+    'line_nr' => 4,
+    'macro' => '',
+    'text' => 'unreferenced node `!_"#$%&\'()*+-.\'',
+    'type' => 'warning'
+  },
+  {
+    'error_line' => ':5: warning: unreferenced node `/;<=>?[\\]^_`|~\'
+',
+    'file_name' => '',
+    'line_nr' => 5,
+    'macro' => '',
+    'text' => 'unreferenced node `/;<=>?[\\]^_`|~\'',
+    'type' => 'warning'
+  },
+  {
+    'error_line' => ':6: warning: unreferenced node `local   node\'
+',
+    'file_name' => '',
+    'line_nr' => 6,
+    'macro' => '',
+    'text' => 'unreferenced node `local   node\'',
+    'type' => 'warning'
+  }
+];
 
 
 1;

Index: t/results/sectioning/node.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/sectioning/node.pl,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- t/results/sectioning/node.pl        30 Oct 2010 18:48:14 -0000      1.22
+++ t/results/sectioning/node.pl        30 Oct 2010 19:33:49 -0000      1.23
@@ -758,6 +758,60 @@
     'macro' => '',
     'text' => 'Superfluous arguments for node',
     'type' => 'warning'
+  },
+  {
+    'error_line' => ':3: warning: unreferenced node `one arg2\'
+',
+    'file_name' => '',
+    'line_nr' => 3,
+    'macro' => '',
+    'text' => 'unreferenced node `one arg2\'',
+    'type' => 'warning'
+  },
+  {
+    'error_line' => ':4: warning: unreferenced node `one arg3\'
+',
+    'file_name' => '',
+    'line_nr' => 4,
+    'macro' => '',
+    'text' => 'unreferenced node `one arg3\'',
+    'type' => 'warning'
+  },
+  {
+    'error_line' => ':5: warning: unreferenced node `one arg4\'
+',
+    'file_name' => '',
+    'line_nr' => 5,
+    'macro' => '',
+    'text' => 'unreferenced node `one arg4\'',
+    'type' => 'warning'
+  },
+  {
+    'error_line' => ':6: warning: unreferenced node `one arg5\'
+',
+    'file_name' => '',
+    'line_nr' => 6,
+    'macro' => '',
+    'text' => 'unreferenced node `one arg5\'',
+    'type' => 'warning'
+  },
+  {
+    'error_line' => ':8: warning: unreferenced node `comment\'
+',
+    'file_name' => '',
+    'line_nr' => 8,
+    'macro' => '',
+    'text' => 'unreferenced node `comment\'',
+    'type' => 'warning'
+  },
+  {
+    'error_line' => ':10: warning: unreferenced node `arg1 @comma{} arg2\'
+',
+    'file_name' => '',
+    'line_nr' => 10,
+    'macro' => '',
+    'text' => 'unreferenced node `arg1 @comma{} arg2\'',
+    'type' => 'warning'
   }
 ];
 

Index: t/results/sectioning/nodename_parentheses.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/sectioning/nodename_parentheses.pl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- t/results/sectioning/nodename_parentheses.pl        30 Oct 2010 19:08:18 
-0000      1.12
+++ t/results/sectioning/nodename_parentheses.pl        30 Oct 2010 19:33:49 
-0000      1.13
@@ -966,6 +966,15 @@
     'macro' => '',
     'text' => 'Syntax for an external node used for `(manual)anchor\'',
     'type' => 'error'
+  },
+  {
+    'error_line' => ':22: warning: unreferenced node `node\'
+',
+    'file_name' => '',
+    'line_nr' => 22,
+    'macro' => '',
+    'text' => 'unreferenced node `node\'',
+    'type' => 'warning'
   }
 ];
 

Index: t/results/value/value_node_directions.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/value/value_node_directions.pl,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- t/results/value/value_node_directions.pl    30 Oct 2010 19:08:19 -0000      
1.22
+++ t/results/value/value_node_directions.pl    30 Oct 2010 19:33:49 -0000      
1.23
@@ -629,7 +629,26 @@
 
$result_sectioning{'value_node_directions'}{'section_childs'}[0]{'section_childs'}[1]{'section_up'}
 = $result_sectioning{'value_node_directions'}{'section_childs'}[0];
 $result_sectioning{'value_node_directions'}{'section_childs'}[0]{'section_up'} 
= $result_sectioning{'value_node_directions'};
 
-$result_errors{'value_node_directions'} = [];
+$result_errors{'value_node_directions'} = [
+  {
+    'error_line' => ':7: warning: unreferenced node `bar\'
+',
+    'file_name' => '',
+    'line_nr' => 7,
+    'macro' => '',
+    'text' => 'unreferenced node `bar\'',
+    'type' => 'warning'
+  },
+  {
+    'error_line' => ':10: warning: unreferenced node `BarFoo\'
+',
+    'file_name' => '',
+    'line_nr' => 10,
+    'macro' => '',
+    'text' => 'unreferenced node `BarFoo\'',
+    'type' => 'warning'
+  }
+];
 
 
 1;



reply via email to

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