[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[7109] Reduce references to Texinfo::Parser module
From: |
Gavin D. Smith |
Subject: |
[7109] Reduce references to Texinfo::Parser module |
Date: |
Sat, 09 Apr 2016 13:20:20 +0000 |
Revision: 7109
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7109
Author: gavin
Date: 2016-04-09 13:20:19 +0000 (Sat, 09 Apr 2016)
Log Message:
-----------
Reduce references to Texinfo::Parser module
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Texinfo/Convert/HTML.pm
trunk/tp/Texinfo/Parser.pm
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2016-04-09 11:58:44 UTC (rev 7108)
+++ trunk/ChangeLog 2016-04-09 13:20:19 UTC (rev 7109)
@@ -1,5 +1,18 @@
2016-04-09 Gavin Smith <address@hidden>
+ Reduce references to Texinfo::Parser module.
+
+ * tp/Texinfo/Parser.pm (_parse_def): Remove commented-out code.
+ * tp/Texinfo/HTML.pm: Refer to Texinfo::Common::_print_current
+ instead of Texinfo::Parser::_print_current.
+ (command_filename, _convert_key_command)
+ (_convert_indicateurl_command, _convert_ctrl_command)
+ (_convert_titlefont_command, _convert_style_command)
+ (_convert_float_command): Remove commented-out code.
+ * tp/Texinfo/Parser.pm (_parse_node_manual): Add a comment.
+
+2016-04-09 Gavin Smith <address@hidden>
+
* tp/Texinfo/Common.pm (%index_names): Don't set a 'prefix'
array on each member.
(%command_index_prefix): Replace with a new variable called
Modified: trunk/tp/Texinfo/Convert/HTML.pm
===================================================================
--- trunk/tp/Texinfo/Convert/HTML.pm 2016-04-09 11:58:44 UTC (rev 7108)
+++ trunk/tp/Texinfo/Convert/HTML.pm 2016-04-09 13:20:19 UTC (rev 7109)
@@ -302,7 +302,6 @@
return $element->{'filename'};
}
}
- #print STDERR "No filename
".Texinfo::Parser::_print_command_args_texi($command);
return undef;
}
@@ -508,7 +507,7 @@
} else {
if (!$command->{'extra'}->{'misc_content'}) {
cluck "No misc_content: "
- .Texinfo::Parser::_print_current($command);
+ .Texinfo::Common::_print_current($command);
}
if (defined($command->{'number'})
and ($self->get_conf('NUMBER_SECTIONS')
@@ -1376,7 +1375,6 @@
if (!defined($text)) {
# happens with bogus @-commands without argument, like @strong something
#cluck "text not defined in _convert_style_command";
- #print STDERR Texinfo::Parser::_print_current($command);
return '';
}
# handle the effect of kbdinputstyle
@@ -1749,7 +1747,6 @@
my $text = $args->[0]->{'normal'};
if (!defined($text)) {
# happens with bogus @-commands without argument, like @strong something
- #print STDERR Texinfo::Parser::_print_current($command);
return '';
}
if ($self->in_string()) {
@@ -1782,7 +1779,6 @@
my $text = $args->[0]->{'normal'};
if (!defined($text)) {
# happens with bogus @-commands without argument, like @strong something
- #print STDERR Texinfo::Parser::_print_current($command);
return '';
}
if (!$self->in_string()) {
@@ -1808,7 +1804,6 @@
my $text = $args->[0]->{'normal'};
if (!defined($text)) {
# happens with bogus @-commands without argument, like @strong something
- #print STDERR Texinfo::Parser::_print_current($command);
return '';
}
return $self->protect_text('^') .$text;
@@ -1826,7 +1821,6 @@
my $text = $args->[0]->{'normal'};
if (!defined($text)) {
# happens with bogus @-commands without argument, like @strong something
- #print STDERR Texinfo::Parser::_print_current($command);
return '';
}
return &{$self->{'format_heading_text'}}($self, 'titlefont', $text, 0,
$command);
@@ -2818,8 +2812,6 @@
} else {
$prepended_text = '';
}
- #print STDERR "Float $prepended_text: caption $caption ".
- # Texinfo::Parser::_print_current ($caption)."\n";
if ($caption and $caption_text eq '') {
$caption_text = $self->convert_tree_new_formatting_context(
@@ -3664,7 +3656,7 @@
if (!defined($content)) {
cluck "content undef in _convert_preformatted_type "
- .Texinfo::Parser::_print_current($command);
+ .Texinfo::Common::_print_current($command);
}
my $current = $command;
@@ -5681,7 +5673,7 @@
} elsif ($node_top) {
my $element_top = $node_top->{'parent'};
if (!$element_top) {
- die "No parent for node_top:
".Texinfo::Parser::_print_current($node_top);
+ die "No parent for node_top:
".Texinfo::Common::_print_current($node_top);
}
$self->{'global_target_elements'}->{'Top'} = $element_top;
} else {
@@ -5971,7 +5963,7 @@
######## debug
if (!$element_target->{'type'}) {
die "No type for element_target $direction $element_target: "
- . Texinfo::Parser::_print_current_keys($element_target)
+ . Texinfo::Common::_print_current_keys($element_target)
. "directions :". Texinfo::Structuring::_print_directions($element);
}
########
@@ -7256,7 +7248,7 @@
my $content_formatted = '';
if (ref($root->{'contents'}) ne 'ARRAY') {
cluck "for $root contents not an array: $root->{'contents'}";
- print STDERR Texinfo::Parser::_print_current($root);
+ print STDERR Texinfo::Common::_print_current($root);
}
my $content_idx = 0;
@@ -7264,8 +7256,8 @@
my $new_content = $self->_convert($content, "$command_type
[$content_idx]");
if (!defined($new_content)) {
cluck "content not defined for $command_type [$content_idx]\n";
- print STDERR "root is: ".Texinfo::Parser::_print_current ($root);
- print STDERR "content is: ".Texinfo::Parser::_print_current ($content);
+ print STDERR "root is: ".Texinfo::Common::_print_current ($root);
+ print STDERR "content is: ".Texinfo::Common::_print_current ($content);
} else {
$content_formatted .= $new_content;
}
Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm 2016-04-09 11:58:44 UTC (rev 7108)
+++ trunk/tp/Texinfo/Parser.pm 2016-04-09 13:20:19 UTC (rev 7109)
@@ -2319,6 +2319,15 @@
return $braces_count;
}
+# $NODE->{'contents'} is the Texinfo fo the specification of a node.
+# Returned object is a hash with three fields:
+#
+# manual_content - Texinfo tree for a manual name extracted from the
+# node specification.
+# node_content - Texinfo tree for the node name on its own
+# normalized - a string with the node name after HTML node name
+# normalization is applied
+#
# retrieve a leading manual name in parentheses, if there is one.
sub _parse_node_manual($)
{
@@ -2503,10 +2512,7 @@
# have this leading space appear in the arguments ever, so we ignore
# it here.
push @def_line, ['spaces', $spaces] if ((defined($spaces)) and
scalar(@def_line) != 0);
- #print STDERR "spaces `".Texinfo::Convert::Texinfo::convert($spaces)."'\n"
if (defined($spaces));
last if (!defined($next));
- #print "$next, $next->{'type'}\n";
- #print STDERR "NEXT ".Texinfo::Convert::Texinfo::convert($next)."\n";
if ($next->{'type'} and $next->{'type'} eq 'bracketed_def_content') {
push @def_line, ['bracketed', $next];
} else {
@@ -2517,8 +2523,6 @@
my $arg = shift (@args);
while (@def_line) {
my $token = $def_line[0];
- #print STDERR "next token: $token->[0]. arg $arg\n";
- #print STDERR "NEXT ".Texinfo::Convert::Texinfo::convert($token->[1])."\n";
# finish previous item
if ($token->[0] eq 'spaces' or $token->[0] eq 'bracketed') {
# we create a {'contents' =>} only if there is more than one
@@ -2552,22 +2556,8 @@
} elsif (scalar(@$argument_content) == 1) {
push @result, [$arg, $argument_content->[0]];
}
- #foreach my $arg (@args) {
- # #print STDERR "$command $arg"._print_current($contents[0]);
- # #foreach my $content (@contents) {print STDERR "
"._print_current($content)};
- # #print STDERR " contents ->".Texinfo::Convert::Texinfo::convert
({'contents' => address@hidden);
- # my ($spaces, $next) = $self->_next_bracketed_or_word(address@hidden);
- # last if (!defined($next));
- # #my $spaces_string = 'NOSPACE';
- # #if (defined($spaces)) {
- # # $spaces_string = "`".Texinfo::Convert::Texinfo::convert($spaces)."'";
- # #}
- # #print STDERR "NEXT $spaces_string [$arg]
".Texinfo::Convert::Texinfo::convert($next)."\n";
- # push @result, ['spaces', $spaces] if (defined($spaces));
- # push @result, [$arg, $next];
- #}
+
my @args_results;
- #while (@contents) {
while (@def_line) {
my $spaces;
my $next_token = shift @def_line;
@@ -2576,7 +2566,6 @@
$next_token = shift @def_line;
}
my $next = $next_token->[1];
- #my ($spaces, $next) = $self->_next_bracketed_or_word(address@hidden);
push @args_results, ['spaces', $spaces] if (defined($spaces));
last if (!defined($next));
if (defined($next->{'text'})) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [7109] Reduce references to Texinfo::Parser module,
Gavin D. Smith <=