[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Parser.pm Texinfo/Report.pm ...
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Parser.pm Texinfo/Report.pm ... |
Date: |
Tue, 07 Jun 2011 23:23:17 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/06/07 23:23:17
Modified files:
tp/Texinfo : Parser.pm Report.pm Structuring.pm
tp/Texinfo/Convert: HTML.pm
tp/t/results/sectioning: nodename_parentheses.pl
Log message:
Fix error message for external node syntax used, no leading spaces
and simplify function call.
In Texinfo::Report, allow not to output error messages, if
$self->{'ignore_notice'} is set.
Add an explanation string to the _convert call, mostly to have
more readable cluck traces...
No error messages in contexts of multiple formatting of a texinfo
command.
Handle SIMPLE_MENU and preformat menu_entry and menu_comment if
in_preformatted.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.258&r2=1.259
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Report.pm?cvsroot=texinfo&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Structuring.pm?cvsroot=texinfo&r1=1.62&r2=1.63
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.90&r2=1.91
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/nodename_parentheses.pl?cvsroot=texinfo&r1=1.39&r2=1.40
Patches:
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.258
retrieving revision 1.259
diff -u -b -r1.258 -r1.259
--- Texinfo/Parser.pm 5 Jun 2011 14:03:47 -0000 1.258
+++ Texinfo/Parser.pm 7 Jun 2011 23:23:16 -0000 1.259
@@ -1791,6 +1791,23 @@
}
}
+# 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;
+}
+
+
# retrieve a leading manual name in parentheses, if there is one.
sub _parse_node_manual($)
{
@@ -2335,8 +2352,7 @@
if (@{$float->{'args'}}) {
if ($float->{'args'}->[1]) {
my $float_label = _parse_node_manual($float->{'args'}->[1]);
- _check_internal_node($self, $float_label, $float->{'args'}->[1],
- $line_nr);
+ _check_internal_node($self, $float_label, $line_nr);
if (defined($float_label) and $float_label->{'node_content'}
and $float_label->{'normalized'} =~ /[^-]/) {
_register_label($self, $float, $float_label, $line_nr);
@@ -2573,7 +2589,7 @@
push @{$current->{'extra'}->{'nodes_manuals'}}, $node;
}
if (_check_node_label($self, $current->{'extra'}->{'nodes_manuals'}->[0],
- $current->{'args'}->[0], $command, $line_nr)) {
+ $command, $line_nr)) {
if (_register_label($self, $current,
$current->{'extra'}->{'nodes_manuals'}->[0], $line_nr)) {
$self->{'current_node'} = $current;
@@ -2802,26 +2818,24 @@
}
}
-sub _check_internal_node ($$$$)
+sub _check_internal_node ($$$)
{
my $self = shift;
my $parsed_node = shift;
- my $node = shift;
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'"),
- Texinfo::Convert::Texinfo::convert($node)), $line_nr)
+ _node_extra_to_texi($parsed_node)), $line_nr)
}
}
-sub _check_node_label($$$$$)
+sub _check_node_label($$$$)
{
my $self = shift;
my $parsed_node = shift;
- my $node = shift;
my $command = shift;
my $line_nr = shift;
- _check_internal_node($self, $parsed_node, $node, $line_nr);
+ _check_internal_node($self, $parsed_node, $line_nr);
return _check_empty_node($self, $parsed_node, $command, $line_nr);
}
@@ -4093,7 +4107,7 @@
if ($current->{'parent'}->{'cmdname'} eq 'anchor') {
$current->{'parent'}->{'line_nr'} = $line_nr;
my $parsed_anchor = _parse_node_manual($current);
- if (_check_node_label($self, $parsed_anchor, $current,
+ if (_check_node_label($self, $parsed_anchor,
$current->{'parent'}->{'cmdname'}, $line_nr)) {
_register_label($self, $current->{'parent'},
$parsed_anchor, $line_nr);
Index: Texinfo/Report.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Report.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- Texinfo/Report.pm 4 Jun 2011 11:28:51 -0000 1.8
+++ Texinfo/Report.pm 7 Jun 2011 23:23:17 -0000 1.9
@@ -76,7 +76,7 @@
my $text = shift;
chomp ($text);
my $line_number = shift;
- return if (!defined($line_number));
+ return if (!defined($line_number) or $self->{'ignore_notice'});
my $file = $line_number->{'file_name'};
# otherwise out of source build fail since the file names are different
$file =~ s/^.*\/// if ($self->get_conf('TEST'));
@@ -103,6 +103,7 @@
chomp ($text);
my $line_number = shift;
my $continuation = shift;
+ return if ($self->{'ignore_notice'});
if (defined($line_number)) {
my $file = $line_number->{'file_name'};
$file =~ s/^.*\/// if ($self->get_conf('TEST'));
@@ -124,6 +125,7 @@
{
my $self = shift;
my $text = shift;
+ return if ($self->{'ignore_notice'});
chomp ($text);
my $warn_line = sprintf($self->__("warning: %s\n"), $text);
push @{$self->{'errors_warnings'}},
@@ -134,6 +136,7 @@
{
my $self = shift;
my $text = shift;
+ return if ($self->{'ignore_notice'});
chomp ($text);
$text .= "\n";
push @{$self->{'errors_warnings'}},
@@ -144,6 +147,7 @@
sub file_line_warn($$$;$) {
my $self = shift;
my $text = shift;
+ return if ($self->{'ignore_notice'});
chomp($text);
my $file = shift;
my $line_nr = shift;
Index: Texinfo/Structuring.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Structuring.pm,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- Texinfo/Structuring.pm 5 Jun 2011 23:21:48 -0000 1.62
+++ Texinfo/Structuring.pm 7 Jun 2011 23:23:17 -0000 1.63
@@ -309,22 +309,6 @@
return $sec_root;
}
-# 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;
-}
-
my @node_directions = ('next', 'prev', 'up');
# FIXME i18n?
my %direction_texts = (
@@ -362,7 +346,8 @@
if (!$self->{'novalidate'}) {
$self->line_error (sprintf($self->
__("Menu reference to nonexistent node `%s'"),
-
_node_extra_to_texi($menu_content->{'extra'}->{'menu_entry_node'})),
+ Texinfo::Parser::_node_extra_to_texi(
+ $menu_content->{'extra'}->{'menu_entry_node'})),
$menu_content->{'line_nr'});
}
} else {
@@ -402,7 +387,8 @@
# 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'"),
- _node_extra_to_texi($node->{'extra'})), $node->{'line_nr'});
+ Texinfo::Parser::_node_extra_to_texi($node->{'extra'})),
+ $node->{'line_nr'});
}
my $automatic_directions =
(scalar(@{$node->{'extra'}->{'nodes_manuals'}}) == 1);
@@ -429,15 +415,15 @@
if (!defined($node->{'menu_next'})) {
$self->line_warn(sprintf($self->
__("No node following `%s' in menu, but `%s' follows in
sectioning"),
- _node_extra_to_texi($node->{'extra'}),
- _node_extra_to_texi($node->{'node_next'}->{'extra'})),
+ Texinfo::Parser::_node_extra_to_texi($node->{'extra'}),
+
Texinfo::Parser::_node_extra_to_texi($node->{'node_next'}->{'extra'})),
$node->{'line_nr'})
} elsif ($node->{'menu_next'} ne $node->{'node_next'}) {
$self->line_warn(sprintf($self->
__("Node following `%s' in menu `%s' and in sectioning `%s'
differ"),
- _node_extra_to_texi($node->{'extra'}),
- _node_extra_to_texi($node->{'menu_next'}->{'extra'}),
- _node_extra_to_texi($node->{'node_next'}->{'extra'})),
+ Texinfo::Parser::_node_extra_to_texi($node->{'extra'}),
+
Texinfo::Parser::_node_extra_to_texi($node->{'menu_next'}->{'extra'}),
+
Texinfo::Parser::_node_extra_to_texi($node->{'node_next'}->{'extra'})),
$node->{'line_nr'})
}
}
@@ -473,7 +459,7 @@
$self->line_error (sprintf($self->
__("%s reference to nonexistent `%s'"),
$direction_texts{$direction},
- _node_extra_to_texi($node_direction)),
+ Texinfo::Parser::_node_extra_to_texi($node_direction)),
$node->{'line_nr'});
}
}
@@ -491,17 +477,18 @@
# 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"),
- _node_extra_to_texi($node->{'node_up'}->{'extra'}),
- _node_extra_to_texi($node->{'extra'})),
+
Texinfo::Parser::_node_extra_to_texi($node->{'node_up'}->{'extra'}),
+ Texinfo::Parser::_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"),
- _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'});
+ 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->{'line_nr'});
}
}
}
@@ -944,7 +931,8 @@
and !$self->{'novalidate'}) {
$self->line_error (sprintf($self->__("address@hidden reference to
nonexistent node `%s'"),
$ref->{'cmdname'},
-
_node_extra_to_texi($ref->{'extra'}->{'node_argument'})),
+ Texinfo::Parser::_node_extra_to_texi(
+ $ref->{'extra'}->{'node_argument'})),
$ref->{'line_nr'})
} else {
$ref->{'extra'}->{'label'}
Index: Texinfo/Convert/HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -b -r1.90 -r1.91
--- Texinfo/Convert/HTML.pm 6 Jun 2011 22:34:27 -0000 1.90
+++ Texinfo/Convert/HTML.pm 7 Jun 2011 23:23:17 -0000 1.91
@@ -405,12 +405,15 @@
if ($type eq 'tree') {
return $tree;
} else {
- return $self->_convert($tree);
+ return $self->_convert($tree, 'external manual');
}
}
my $target = $self->_get_target($command);
if ($target) {
+ my $explanation;
+ $explanation = "command_text address@hidden>{'cmdname'}"
+ if ($command->{'cmdname'});
if (defined($target->{$type})) {
return $target->{$type};
}
@@ -420,6 +423,7 @@
and $command->{'extra'}->{'special_element'}) {
my $special_element = $command->{'extra'}->{'special_element'};
$tree = $self->get_conf('SPECIAL_ELEMENTS_NAME')->{$special_element};
+ $explanation = "command_text $special_element";
} elsif ($command->{'cmdname'} and ($command->{'cmdname'} eq 'node'
or $command->{'cmdname'} eq
'anchor')) {
$tree = {'type' => '_code',
@@ -444,12 +448,14 @@
$tree = $self->gdt('Appendix {number} {section_title}',
{'number' => {'text' => $command->{'number'}},
'section_title'
- => {'contents' =>
$command->{'extra'}->{'misc_content'}}});
+ => {'contents'
+ =>
$command->{'extra'}->{'misc_content'}}});
} else {
$tree = $self->gdt('{number} {section_title}',
{'number' => {'text' => $command->{'number'}},
'section_title'
- => {'contents' =>
$command->{'extra'}->{'misc_content'}}});
+ => {'contents'
+ =>
$command->{'extra'}->{'misc_content'}}});
}
} else {
$tree = {'contents' => address@hidden>{'extra'}->{'misc_content'}}]};
@@ -474,13 +480,17 @@
}
print STDERR "DO $target->{'id'}($type)\n" if ($self->get_conf('DEBUG'));
+ #$self->{'ignore_notice'}++ if ($type ne 'text');
+ $self->{'ignore_notice'}++;
if ($type =~ /^(.*)_nonumber$/) {
$tree = $target->{'tree_nonumber'}
if (defined($target->{'tree_nonumber'}));
- $target->{$type} = $self->_convert($tree);
+ $target->{$type} = $self->_convert($tree, $explanation);
} else {
- $target->{$type} = $self->_convert($tree);
+ $target->{$type} = $self->_convert($tree, $explanation);
}
+ #$self->{'ignore_notice'}-- if ($type ne 'text');
+ $self->{'ignore_notice'}--;
pop @{$self->{'document_context'}->[-1]->{'context'}};
return $target->{$type};
@@ -945,7 +955,7 @@
foreach my $explained_command (keys(%explained_commands)) {
$default_commands_args{$explained_command}
- = [['normal'], ['string', 'normal']];
+ = [['normal'], ['string']];
}
# Default for the function references used for the formatting
@@ -1244,8 +1254,10 @@
$explanation_string = $args->[1]->{'string'};
}
if ($command->{'extra'}->{'explanation_contents'}) {
+ $self->{'ignore_notice'}++;
$explanation_string = $self->convert_tree({'type' => '_string',
'contents' => $command->{'extra'}->{'explanation_contents'}});
+ $self->{'ignore_notice'}--;
}
my $opening;
if (defined($explanation_string)) {
@@ -1364,7 +1376,7 @@
$default_commands_conversion{'url'} = \&_convert_uref_command;
my @image_files_extensions = ('.png', '.jpg');
-sub _convert_image_command($$)
+sub _convert_image_command($$$$)
{
my $self = shift;
my $cmdname = shift;
@@ -1397,6 +1409,7 @@
} else {
$image_file = "$basefile.jpg";
}
+ #cluck "err ($self->{'ignore_notice'})";
$self->line_warn(sprintf($self->__("address@hidden file `%s' (for HTML)
not found, using `%s'"), $basefile, $image_file), $command->{'line_nr'});
}
my $alt;
@@ -1951,7 +1964,7 @@
$heading_level = $command->{'level'};
}
- my $heading = $self->command_text($command, 'text');
+ my $heading = $self->command_text($command);
if ($heading ne '' and defined($heading_level)) {
if ($self->in_preformatted()) {
$result .= '<strong>'.$heading.'</strong>'."\n";
@@ -2216,7 +2229,9 @@
my $caption_text;
if ($caption) {
+ $self->{'ignore_notice'}++;
$caption_text = $self->convert_tree($caption->{'args'}->[0]);
+ $self->{'ignore_notice'}--;
} else {
$caption_text = '';
}
@@ -2437,8 +2452,10 @@
and $itemize->{'extra'}->{'command_as_argument'}->{'cmdname'} eq
'bullet') {
$prepend = '';
} else {
+ $self->{'ignore_notice'}++;
$prepend = $self->convert_tree(
{'contents' =>
$itemize->{'extra'}->{'block_command_line_contents'}->[0]});
+ $self->{'ignore_notice'}--;
}
if ($contents =~ /\S/) {
return '<li>' . $prepend .' '. $contents . '</li>';
@@ -2459,8 +2476,10 @@
my $args = $contents;
if ($args->[0]) {
my $tree = $args->[0]->{'tree'};
- if ($command->{'parent'}->{'extra'} and
$command->{'parent'}->{'extra'}->{'command_as_argument'}) {
- my $command_as_argument =
$command->{'parent'}->{'extra'}->{'command_as_argument'};
+ if ($command->{'parent'}->{'extra'}
+ and $command->{'parent'}->{'extra'}->{'command_as_argument'}) {
+ my $command_as_argument
+ = $command->{'parent'}->{'extra'}->{'command_as_argument'};
if ($command_as_argument->{'type'} ne 'definfoenclose_command') {
$tree = {'cmdname' => $command_as_argument->{'cmdname'},
'args' => [{'type' => 'brace_command_arg',
@@ -2722,8 +2741,7 @@
}
$default_commands_conversion{'cindex'} = \&_convert_index_command;
-# not needed to initialize it for a document, since it is reset
-# in index_summary
+my %formatted_index_entries;
sub _convert_printindex_command($$$$)
{
@@ -2816,6 +2834,15 @@
foreach my $index_entry_ref (@{$letter_entry->{'entries'}}) {
my $in_code
=
$self->{'index_names'}->{$index_name}->{$index_entry_ref->{'index_name'}};
+
+ my $already_formatted;
+ if (!$formatted_index_entries{$index_entry_ref}) {
+ $formatted_index_entries{$index_entry_ref} = 1;
+ } else {
+ $already_formatted = 1;
+ $self->{'ignore_notice'}++;
+ }
+
my $entry;
if ($in_code) {
# FIXME clean state
@@ -2824,6 +2851,10 @@
} else {
$entry = $self->convert_tree({'contents' =>
$index_entry_ref->{'content'}});
}
+ if ($already_formatted) {
+ $self->{'ignore_notice'}--;
+ }
+
next if ($entry !~ /\S/);
$entry = '<code>' .$entry .'</code>' if ($in_code);
my $entry_href = $self->command_href ($index_entry_ref->{'command'});
@@ -3163,8 +3194,10 @@
my $section;
my $node_entry = $command->{'extra'}->{'menu_entry_node'};
# external node
+ my $external_node;
if ($node_entry->{'manual_content'}) {
$href = $self->command_href($node_entry);
+ $external_node = 1;
} else {
$node = $self->label_command($node_entry->{'normalized'});
# if NODE_NAME_IN_MENU, we pick the associated section, except if
@@ -3182,13 +3215,14 @@
$html_menu_entry_index++;
my $accesskey = '';
$accesskey = " accesskey=\"$html_menu_entry_index\""
- if ($self->get_conf('USE_ACCESSKEY') and ($html_menu_entry_index < 10));
+ if ($self->get_conf('USE_ACCESSKEY') and $html_menu_entry_index < 10);
my $MENU_SYMBOL = $self->get_conf('MENU_SYMBOL');
my $MENU_ENTRY_COLON = $self->get_conf('MENU_ENTRY_COLON');
if ($self->in_preformatted()) {
my $result = '';
+ my $i = 0;
foreach my $arg (@{$command->{'args'}}) {
if ($arg->{'type'} and $arg->{'type'} eq 'menu_entry_node') {
my $name = $self->convert_tree(
@@ -3204,10 +3238,12 @@
$text =~ s/\*/$MENU_SYMBOL/;
$result .= $text;
} else {
- $result .= $self->convert_tree($arg);
+ $result .= $self->convert_tree($arg, "menu_arg preformatted [$i]");
}
+ $i++;
}
- return $result;
+ return &{$self->{'types_conversion'}->{'preformatted'}}($self,
+ {'type' => 'preformatted', 'parent' => $command->{'parent'}}, $result);
}
my $name;
@@ -3233,7 +3269,8 @@
$name = $self->command_text($node_entry);
} else {
$name = $self->convert_tree({'type' => '_code',
- 'contents' => $node_entry->{'node_content'}});
+ 'contents' => $node_entry->{'node_content'}},
+ "menu_arg name");
}
}
$name =~ s/^\s*//;
@@ -3245,7 +3282,8 @@
}
my $description = '';
if ($command->{'extra'}->{'menu_entry_description'}) {
- $description = $self->convert_tree
($command->{'extra'}->{'menu_entry_description'});
+ $description = $self->convert_tree
($command->{'extra'}->{'menu_entry_description'},
+ "menu_arg description");
if ($self->get_conf('AVOID_MENU_REDUNDANCY')) {
$description = '' if (_simplify_text_for_comparison($name_no_number)
eq _simplify_text_for_comparison($description));
@@ -3280,8 +3318,12 @@
my $command = shift;
my $content = shift;
+ if ($self->in_preformatted()) {
+ return $content;
+ } else {
return "<tr><th colspan=\"3\" align=\"left\" valign=\"top\">".$content
."</th></tr>";
+ }
}
$default_types_conversion{'menu_comment'} = \&_convert_menu_comment_type;
@@ -3634,6 +3676,7 @@
}
$foot_num = 0;
$foot_lines = '';
+ %formatted_index_entries = ();
%{$self->{'css_map'}} = %css_map;
@@ -3750,12 +3793,13 @@
}
# the entry point for _convert
-sub convert_tree($$)
+sub convert_tree($$;$)
{
my $self = shift;
my $element = shift;
+ my $explanation = shift;
- return $self->_convert($element);
+ return $self->_convert($element, $explanation);
}
sub _normalized_to_id($)
@@ -5003,8 +5047,10 @@
my $title;
if ($command) {
+ $self->{'ignore_notice'}++;
my $command_string =
$self->command_text($command, 'string');
+ $self->{'ignore_notice'}--;
if (defined($command_string)
and $command_string ne $self->{'title_string'}) {
print STDERR "DO <title>\n"
@@ -5012,8 +5058,10 @@
my $title_tree = $self->gdt('{title}: {element_text}',
{ 'title' => $self->{'title_tree'},
'element_text' => $self->command_text($command, 'tree')});
+ $self->{'ignore_notice'}++;
$title = $self->_convert({'type' => '_string',
'contents' => [$title_tree]});
+ $self->{'ignore_notice'}--;
}
}
$title = $self->{'title_string'} if (!defined($title));
@@ -5692,15 +5740,26 @@
# preformatted
-sub _convert($$);
+sub _convert($$;$);
-sub _convert($$)
+sub _convert($$;$)
{
my $self = shift;
my $root = shift;
+ # only used for debug
+ my $explanation = shift;
+
+ # to help debug and trace
+ my $command_type = '';
+ if ($root->{'cmdname'}) {
+ $command_type = "address@hidden>{'cmdname'} ";
+ }
+ if (defined($root->{'type'})) {
+ $command_type .= $root->{'type'};
+ }
if ($self->get_conf('DEBUG')) {
- print STDERR "ROOT:$root
(".join('|',@{$self->{'document_context'}->[-1]->{'context'}})."), ->";
+ print STDERR "ROOT($explanation):$root
(".join('|',@{$self->{'document_context'}->[-1]->{'context'}})."), ->";
print STDERR " cmd: $root->{'cmdname'}," if ($root->{'cmdname'});
print STDERR " type: $root->{'type'}" if ($root->{'type'});
my $text = $root->{'text'};
@@ -5761,7 +5820,7 @@
#if ($root->{'extra'} and $root->{'extra'}->{'index_entry'}) {
#}
- #and !$self->{'multiple_pass'} and !$self->{'in_copying_header'}) {
+ #and !$self->{'mmultiple_pass'} and !$self->{'in_copying_header'}) {
# special case for index entry not associated with a node but seen.
# this will be an index entry in @copying, in @insertcopying.
# if (!$root->{'extra'}->{'index_entry'}->{'node'} and $self->{'node'}) {
@@ -5801,7 +5860,8 @@
if (exists($block_commands{$command_name})) {
push @{$self->{'document_context'}->[-1]->{'formats'}}, $command_name;
}
- if ($preformatted_commands_context{$command_name}) {
+ if ($preformatted_commands_context{$command_name}
+ or $command_name eq 'menu' and $self->get_conf('SIMPLE_MENU')) {
push @{$self->{'document_context'}->[-1]->{'preformatted_context'}},
$command_name;
}
if ($code_style_commands{$command_name} or
@@ -5821,7 +5881,8 @@
# TODO different types of contents
my $content_idx = 0;
foreach my $content (@{$root->{'contents'}}) {
- my $new_content = $self->_convert($content);
+ my $new_content = $self->_convert($content,
+ "$command_type [$content_idx]");
if (!defined($new_content)) {
print STDERR "content $content_idx not defined for
".Texinfo::Parser::_print_current ($root);
print STDERR "content is: ".Texinfo::Parser::_print_current
($content);
@@ -5848,25 +5909,27 @@
my @args_specification;
@args_specification = @{$self->{'commands_args'}->{$command_name}}
if (defined($self->{'commands_args'}->{$command_name}));
+ my $arg_idx = 0;
foreach my $arg (@{$root->{'args'}}) {
my $arg_spec = shift @args_specification;
$arg_spec = ['normal'] if (!defined($arg_spec));
my $arg_formatted = {'tree' => $arg};
foreach my $arg_type (@$arg_spec) {
+ my $explanation = "$command_type \[$arg_idx\]$arg_type";
if ($arg_type eq 'normal') {
- $arg_formatted->{'normal'} = $self->_convert($arg);
+ $arg_formatted->{'normal'} = $self->_convert($arg,
$explanation);
} elsif ($arg_type eq 'code') {
$self->{'document_context'}->[-1]->{'context'}->[-1]->{'code'}++;
- $arg_formatted->{$arg_type} = $self->_convert($arg);
+ $arg_formatted->{$arg_type} = $self->_convert($arg,
$explanation);
$self->{'document_context'}->[-1]->{'context'}->[-1]->{'code'}--;
} elsif ($arg_type eq 'string') {
$self->{'document_context'}->[-1]->{'context'}->[-1]->{$arg_type}++;
- $arg_formatted->{$arg_type} = $self->_convert($arg);
+ $arg_formatted->{$arg_type} = $self->_convert($arg,
$explanation);
$self->{'document_context'}->[-1]->{'context'}->[-1]->{$arg_type}--;
} elsif ($arg_type eq 'codestring') {
$self->{'document_context'}->[-1]->{'context'}->[-1]->{'code'}++;
$self->{'document_context'}->[-1]->{'context'}->[-1]->{'string'}++;
- $arg_formatted->{$arg_type} = $self->_convert($arg);
+ $arg_formatted->{$arg_type} = $self->_convert($arg,
$explanation);
$self->{'document_context'}->[-1]->{'context'}->[-1]->{'string'}--;
$self->{'document_context'}->[-1]->{'context'}->[-1]->{'code'}--;
} elsif ($arg_type eq 'text') {
@@ -5877,6 +5940,7 @@
}
push @$args_formatted, $arg_formatted;
+ $arg_idx++;
}
}
if (!defined($self->{'commands_conversion'}->{$command_name})) {
@@ -5889,7 +5953,8 @@
$result = &{$self->{'commands_conversion'}->{$command_name}}($self,
$command_name, $root, $content_formatted);
}
- if ($preformatted_commands_context{$command_name}) {
+ if ($preformatted_commands_context{$command_name}
+ or $command_name eq 'menu' and $self->get_conf('SIMPLE_MENU')) {
pop @{$self->{'document_context'}->[-1]->{'preformatted_context'}};
}
if ($code_style_commands{$command_name} or
@@ -5959,14 +6024,16 @@
if ($root->{'type'} eq 'text_root') {
$only_spaces = 1;
}
+ my $i = 0;
foreach my $content (@{$root->{'contents'}}) {
- my $new_content = $self->_convert($content);
+ my $new_content = $self->_convert($content, "$command_type [$i]");
if ($only_spaces) {
if ($new_content =~ /\S/) {
$only_spaces = 0;
}
}
$content_formatted .= $new_content unless ($only_spaces);
+ $i++;
}
}
my $result = '';
@@ -5998,8 +6065,10 @@
} elsif ($root->{'contents'}) {
# FIXME document situations where that happens? Use virtual types?
my $content_formatted = '';
+ my $i = 0;
foreach my $content (@{$root->{'contents'}}) {
- $content_formatted .= $self->_convert($content);
+ $content_formatted .= $self->_convert($content, "$command_type [$i]");
+ $i++;
}
print STDERR "UNNAMED HOLDER => `$content_formatted'\n"
if ($self->get_conf('DEBUG'));
Index: t/results/sectioning/nodename_parentheses.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/sectioning/nodename_parentheses.pl,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- t/results/sectioning/nodename_parentheses.pl 4 Jun 2011 17:02:23
-0000 1.39
+++ t/results/sectioning/nodename_parentheses.pl 7 Jun 2011 23:23:17
-0000 1.40
@@ -1255,14 +1255,12 @@
$result_errors{'nodename_parentheses'} = [
{
- 'error_line' => ':22: Syntax for an external node used for ` (manual)node
-\'
+ 'error_line' => ':22: Syntax for an external node used for `(manual)node\'
',
'file_name' => '',
'line_nr' => 22,
'macro' => '',
- 'text' => 'Syntax for an external node used for ` (manual)node
-\'',
+ 'text' => 'Syntax for an external node used for `(manual)node\'',
'type' => 'error'
},
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp Texinfo/Parser.pm Texinfo/Report.pm ...,
Patrice Dumas <=