[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Convert/Plaintext.pm t/19def...
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Convert/Plaintext.pm t/19def... |
Date: |
Mon, 07 Feb 2011 00:18:31 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/02/07 00:18:31
Modified files:
tp/Texinfo/Convert: Plaintext.pm
tp/t : 19def.t
Added files:
tp/t/results/def: no_category_or_no_name.pl
Log message:
Avoid spurious debug message with @def*x command without name or
category.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.75&r2=1.76
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/19def.t?cvsroot=texinfo&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/def/no_category_or_no_name.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -b -r1.75 -r1.76
--- Texinfo/Convert/Plaintext.pm 6 Feb 2011 23:44:56 -0000 1.75
+++ Texinfo/Convert/Plaintext.pm 7 Feb 2011 00:18:30 -0000 1.76
@@ -1829,7 +1829,13 @@
}
#} els
if ($unknown_command and !($root->{'extra'}
- and $root->{'extra'}->{'index_entry'})) {
+ and $root->{'extra'}->{'index_entry'})
+ #Â commands like def*x are not processed above, since only the def_line
+ #Â associated is processed. If they have no name and no category they
+ #Â are not considered as index entries either so they have a specific
+ #Â condition
+ and !($def_commands{$root->{'cmdname'}}
+ and $root->{'cmdname'} =~ /x$/)) {
warn "Unhandled $root->{'cmdname'}\n";
$result .= "!!!!!!!!! Unhandled $root->{'cmdname'} !!!!!!!!!\n";
}
Index: t/19def.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/19def.t,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- t/19def.t 17 Jan 2011 00:57:23 -0000 1.10
+++ t/19def.t 7 Feb 2011 00:18:31 -0000 1.11
@@ -263,6 +263,21 @@
'@deffn c @{
@end deffn
'],
+['no_category_or_no_name',
+'@deffn
+no category no name
address@hidden deffn
+
address@hidden {only category}
+no name
address@hidden deffn
+
address@hidden a b c d
address@hidden deffnx_category
address@hidden
+with deffnx missing category or name
address@hidden deffn
+'],
);
my @test_invalid = (
Index: t/results/def/no_category_or_no_name.pl
===================================================================
RCS file: t/results/def/no_category_or_no_name.pl
diff -N t/results/def/no_category_or_no_name.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/def/no_category_or_no_name.pl 7 Feb 2011 00:18:31 -0000
1.1
@@ -0,0 +1,440 @@
+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{'no_category_or_no_name'} = {
+ 'contents' => [
+ {
+ 'cmdname' => 'deffn',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'extra' => {
+ 'def_command' => 'deffn',
+ 'original_def_cmdname' => 'deffn'
+ },
+ 'parent' => {},
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'no category no name
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'deffn',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'only category'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'bracketed'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'extra' => {
+ 'def_args' => [
+ [
+ 'category',
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'bracketed_def_content'
+ }
+ ]
+ ],
+ 'def_command' => 'deffn',
+ 'def_parsed_hash' => {
+ 'category' => {}
+ },
+ 'original_def_cmdname' => 'deffn'
+ },
+ 'parent' => {},
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'no name
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'deffn',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'a b c d
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'extra' => {
+ 'def_args' => [
+ [
+ 'category',
+ {
+ 'text' => 'a'
+ }
+ ],
+ [
+ 'spaces',
+ {
+ 'text' => ' ',
+ 'type' => 'spaces'
+ }
+ ],
+ [
+ 'name',
+ {
+ 'text' => 'b'
+ }
+ ],
+ [
+ 'spaces',
+ {
+ 'text' => ' ',
+ 'type' => 'spaces'
+ }
+ ],
+ [
+ 'arg',
+ {
+ 'text' => 'c'
+ }
+ ],
+ [
+ 'spaces',
+ {
+ 'text' => ' ',
+ 'type' => 'spaces'
+ }
+ ],
+ [
+ 'arg',
+ {
+ 'text' => 'd'
+ }
+ ]
+ ],
+ 'def_command' => 'deffn',
+ 'def_parsed_hash' => {
+ 'category' => {},
+ 'name' => {}
+ },
+ 'index_entry' => {
+ 'command' => {},
+ 'content' => [
+ {}
+ ],
+ 'index_at_command' => 'deffn',
+ 'index_name' => 'fn',
+ 'index_prefix' => 'f',
+ 'number' => 1
+ },
+ 'original_def_cmdname' => 'deffn'
+ },
+ 'parent' => {},
+ 'type' => 'def_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'deffnx_category
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'deffnx',
+ 'extra' => {
+ 'def_args' => [
+ [
+ 'category',
+ {
+ 'text' => 'deffnx_category'
+ }
+ ]
+ ],
+ 'def_command' => 'deffn',
+ 'def_parsed_hash' => {
+ 'category' => {}
+ },
+ 'original_def_cmdname' => 'deffnx'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => ''
+ },
+ 'parent' => {},
+ 'type' => 'def_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'deffnx',
+ 'extra' => {
+ 'def_command' => 'deffn',
+ 'original_def_cmdname' => 'deffnx'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => ''
+ },
+ 'parent' => {},
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'with deffnx missing category or name
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'no_category_or_no_name'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[0]{'contents'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[0]{'contents'}[1]{'contents'}[0]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[0]{'contents'}[1];
+$result_trees{'no_category_or_no_name'}{'contents'}[0]{'contents'}[1]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[0]{'parent'} =
$result_trees{'no_category_or_no_name'};
+$result_trees{'no_category_or_no_name'}{'contents'}[1]{'parent'} =
$result_trees{'no_category_or_no_name'};
+$result_trees{'no_category_or_no_name'}{'contents'}[2]{'parent'} =
$result_trees{'no_category_or_no_name'};
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'args'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[1]{'contents'}[0]{'parent'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[1];
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[1]{'parent'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'args'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[2]{'parent'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'args'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'args'}[0]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'extra'}{'def_args'}[0][1]{'contents'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[1]{'contents'};
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'extra'}{'def_args'}[0][1]{'parent'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'args'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'extra'}{'def_parsed_hash'}{'category'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'extra'}{'def_args'}[0][1];
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[0]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[3];
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[1];
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'contents'}[1]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[3];
+$result_trees{'no_category_or_no_name'}{'contents'}[3]{'parent'} =
$result_trees{'no_category_or_no_name'};
+$result_trees{'no_category_or_no_name'}{'contents'}[4]{'parent'} =
$result_trees{'no_category_or_no_name'};
+$result_trees{'no_category_or_no_name'}{'contents'}[5]{'parent'} =
$result_trees{'no_category_or_no_name'};
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'args'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'args'}[0]{'contents'}[1]{'parent'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'args'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'args'}[0]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'extra'}{'def_parsed_hash'}{'category'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'extra'}{'def_args'}[0][1];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'extra'}{'def_parsed_hash'}{'name'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'extra'}{'def_args'}[2][1];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'extra'}{'index_entry'}{'command'}
= $result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'extra'}{'index_entry'}{'content'}[0]
=
$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'extra'}{'def_args'}[2][1];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[0]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[6];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[1]{'args'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[1]{'args'}[0]{'contents'}[1]{'parent'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[1]{'args'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[1]{'args'}[0]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[1];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[1]{'extra'}{'def_parsed_hash'}{'category'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[1]{'extra'}{'def_args'}[0][1];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[1]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[6];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[2]{'args'}[0];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[2]{'args'}[0]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[2];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[2]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[6];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[3]{'contents'}[0]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[3];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'contents'}[3]{'parent'}
= $result_trees{'no_category_or_no_name'}{'contents'}[6];
+$result_trees{'no_category_or_no_name'}{'contents'}[6]{'parent'} =
$result_trees{'no_category_or_no_name'};
+$result_trees{'no_category_or_no_name'}{'contents'}[7]{'parent'} =
$result_trees{'no_category_or_no_name'};
+
+$result_texis{'no_category_or_no_name'} = '@deffn
+no category no name
address@hidden deffn
+
address@hidden {only category}
+no name
address@hidden deffn
+
address@hidden a b c d
address@hidden deffnx_category
address@hidden
+with deffnx missing category or name
address@hidden deffn
+';
+
+
+$result_texts{'no_category_or_no_name'} = 'no category no name
+
+only category
+no name
+
+a b c d
+deffnx_category
+with deffnx missing category or name
+';
+
+$result_errors{'no_category_or_no_name'} = [
+ {
+ 'error_line' => ':1: warning: Missing category for @deffn
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => 'Missing category for @deffn',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => ':5: warning: Missing name for @deffn
+',
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => '',
+ 'text' => 'Missing name for @deffn',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => ':10: warning: Missing name for @deffnx
+',
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => '',
+ 'text' => 'Missing name for @deffnx',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => ':11: warning: Missing category for @deffnx
+',
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => '',
+ 'text' => 'Missing category for @deffnx',
+ 'type' => 'warning'
+ }
+];
+
+
+
+$result_converted{'plaintext'}->{'no_category_or_no_name'} = ' no category
no name
+
+ -- only category:
+ no name
+
+ -- a: b c d
+ -- deffnx_category:
+ with deffnx missing category or name
+';
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp Texinfo/Convert/Plaintext.pm t/19def...,
Patrice Dumas <=