[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Structuring.pm t/10menu.t t/...
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Structuring.pm t/10menu.t t/... |
Date: |
Sat, 19 Feb 2011 13:12:39 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/02/19 13:12:37
Modified files:
tp/Texinfo : Structuring.pm
tp/t : 10menu.t
Added files:
tp/t/results/menu: multiple_menus.pl
Log message:
Warn for multiple menus.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Structuring.pm?cvsroot=texinfo&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/10menu.t?cvsroot=texinfo&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/menu/multiple_menus.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: Texinfo/Structuring.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Structuring.pm,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- Texinfo/Structuring.pm 6 Feb 2011 10:06:59 -0000 1.30
+++ Texinfo/Structuring.pm 19 Feb 2011 13:12:34 -0000 1.31
@@ -334,6 +334,12 @@
foreach my $node (@{$self->{'nodes'}}) {
$top_node = $node if ($node->{'extra'}->{'normalized'} eq 'Top');
if ($node->{'menus'}) {
+ if ($self->{'SHOW_MENU'} and @{$node->{'menus'}} > 1) {
+ foreach my $menu (@{$node->{'menus'}}[1 .. $#{$node->{'menus'}}]) {
+ $self->line_warn (sprintf($self->__("Multiple address@hidden"),
+ $menu->{'cmdname'}), $menu->{'line_nr'});
+ }
+ }
foreach my $menu (@{$node->{'menus'}}) {
my $previous_node;
foreach my $menu_content (@{$menu->{'contents'}}) {
Index: t/10menu.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/10menu.t,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- t/10menu.t 19 Feb 2011 11:33:21 -0000 1.10
+++ t/10menu.t 19 Feb 2011 13:12:35 -0000 1.11
@@ -157,6 +157,17 @@
@end menu
@end deffn
'],
+['multiple_menus',
+'@node Top
+
address@hidden
+* (a)a::
address@hidden menu
+
address@hidden
+* (b)b::
address@hidden menu
+'],
);
foreach my $test (@test_cases) {
Index: t/results/menu/multiple_menus.pl
===================================================================
RCS file: t/results/menu/multiple_menus.pl
diff -N t/results/menu/multiple_menus.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/menu/multiple_menus.pl 19 Feb 2011 13:12:36 -0000 1.1
@@ -0,0 +1,336 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors);
+
+$result_trees{'multiple_menus'} = {
+ 'contents' => [
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'text_root'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'Top'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'spaces_at_end'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'menu',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => '* ',
+ 'type' => 'menu_entry_leading_text'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '(a)a'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'menu_entry_node'
+ },
+ {
+ 'parent' => {},
+ 'text' => '::',
+ 'type' => 'menu_entry_separator'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'menu_entry_description'
+ }
+ ],
+ 'extra' => {
+ 'menu_entry_node' => {
+ 'manual_content' => [
+ {
+ 'parent' => {},
+ 'text' => 'a'
+ }
+ ],
+ 'node_content' => [
+ {
+ 'parent' => {},
+ 'text' => 'a'
+ }
+ ],
+ 'normalized' => 'a'
+ }
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ },
+ 'parent' => {},
+ 'type' => 'menu_entry'
+ }
+ ],
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'menu',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => '* ',
+ 'type' => 'menu_entry_leading_text'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '(b)b'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'menu_entry_node'
+ },
+ {
+ 'parent' => {},
+ 'text' => '::',
+ 'type' => 'menu_entry_separator'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'menu_entry_description'
+ }
+ ],
+ 'extra' => {
+ 'menu_entry_node' => {
+ 'manual_content' => [
+ {
+ 'parent' => {},
+ 'text' => 'b'
+ }
+ ],
+ 'node_content' => [
+ {
+ 'parent' => {},
+ 'text' => 'b'
+ }
+ ],
+ 'normalized' => 'b'
+ }
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => ''
+ },
+ 'parent' => {},
+ 'type' => 'menu_entry'
+ }
+ ],
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ }
+ ],
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [],
+ 'normalized' => 'Top'
+ }
+ ],
+ 'normalized' => 'Top'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'multiple_menus'}{'contents'}[0]{'parent'} =
$result_trees{'multiple_menus'};
+$result_trees{'multiple_menus'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'args'}[0];
+$result_trees{'multiple_menus'}{'contents'}[1]{'args'}[0]{'contents'}[1]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'args'}[0];
+$result_trees{'multiple_menus'}{'contents'}[1]{'args'}[0]{'contents'}[2]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'args'}[0];
+$result_trees{'multiple_menus'}{'contents'}[1]{'args'}[0]{'parent'} =
$result_trees{'multiple_menus'}{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[0]{'parent'} =
$result_trees{'multiple_menus'}{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[0]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[1]{'contents'}[0]{'parent'}
=
$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[1]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[2]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[3]{'contents'}[0]{'parent'}
=
$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[3];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[3]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'extra'}{'menu_entry_node'}{'manual_content'}[0]{'parent'}
=
$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'extra'}{'menu_entry_node'}{'node_content'}[0]{'parent'}
=
$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[1]{'parent'} =
$result_trees{'multiple_menus'}{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[2]{'parent'} =
$result_trees{'multiple_menus'}{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[3]{'parent'} =
$result_trees{'multiple_menus'}{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[0]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'args'}[0]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'args'}[1]{'contents'}[0]{'parent'}
=
$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'args'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'args'}[1]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'args'}[2]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'args'}[3]{'contents'}[0]{'parent'}
=
$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'args'}[3];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'args'}[3]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'extra'}{'menu_entry_node'}{'manual_content'}[0]{'parent'}
=
$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'args'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'extra'}{'menu_entry_node'}{'node_content'}[0]{'parent'}
=
$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'args'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'contents'}[1]{'parent'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[4]{'parent'} =
$result_trees{'multiple_menus'}{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'contents'}[5]{'parent'} =
$result_trees{'multiple_menus'}{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'extra'}{'node_content'}[0] =
$result_trees{'multiple_menus'}{'contents'}[1]{'args'}[0]{'contents'}[1];
+$result_trees{'multiple_menus'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'}
= $result_trees{'multiple_menus'}{'contents'}[1]{'extra'}{'node_content'};
+$result_trees{'multiple_menus'}{'contents'}[1]{'parent'} =
$result_trees{'multiple_menus'};
+
+$result_texis{'multiple_menus'} = '@node Top
+
address@hidden
+* (a)a::
address@hidden menu
+
address@hidden
+* (b)b::
address@hidden menu
+';
+
+
+$result_texts{'multiple_menus'} = '
+* (a)a::
+
+* (b)b::
+';
+
+$result_sectioning{'multiple_menus'} = {};
+
+$result_nodes{'multiple_menus'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ },
+ 'menus' => [
+ {
+ 'cmdname' => 'menu'
+ },
+ {
+ 'cmdname' => 'menu'
+ }
+ ],
+ 'node_up' => {
+ 'extra' => {
+ 'manual_content' => [
+ {
+ 'text' => 'dir'
+ }
+ ]
+ }
+ }
+};
+
+$result_menus{'multiple_menus'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+};
+
+$result_errors{'multiple_menus'} = [
+ {
+ 'error_line' => ':7: warning: Multiple @menu
+',
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => '',
+ 'text' => 'Multiple @menu',
+ 'type' => 'warning'
+ }
+];
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp Texinfo/Structuring.pm t/10menu.t t/...,
Patrice Dumas <=