[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[6064] parsetexi don't create associated section by mistake
From: |
Gavin D. Smith |
Subject: |
[6064] parsetexi don't create associated section by mistake |
Date: |
Fri, 23 Jan 2015 23:35:22 +0000 |
Revision: 6064
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6064
Author: gavin
Date: 2015-01-23 23:35:22 +0000 (Fri, 23 Jan 2015)
Log Message:
-----------
parsetexi don't create associated section by mistake
Modified Paths:
--------------
trunk/parsetexi/ChangeLog
trunk/parsetexi/Parsetexi/lib/Parsetexi.pm
Modified: trunk/parsetexi/ChangeLog
===================================================================
--- trunk/parsetexi/ChangeLog 2015-01-23 19:36:54 UTC (rev 6063)
+++ trunk/parsetexi/ChangeLog 2015-01-23 23:35:22 UTC (rev 6064)
@@ -12,6 +12,9 @@
more than one parameter before adding
ET_empty_spaces_before_argument.
+ * Parsetexi/lib/Parsetexi.pm (_find_menus_of_node): Don't set
+ 'associated_section' by mistake.
+
2015-01-23 Gavin Smith <address@hidden>
* Parsetexi/lib/Parsetexi.pm: Update a comment.
Modified: trunk/parsetexi/Parsetexi/lib/Parsetexi.pm
===================================================================
--- trunk/parsetexi/Parsetexi/lib/Parsetexi.pm 2015-01-23 19:36:54 UTC (rev
6063)
+++ trunk/parsetexi/Parsetexi/lib/Parsetexi.pm 2015-01-23 23:35:22 UTC (rev
6064)
@@ -188,8 +188,21 @@
sub _find_menus_of_node ($) {
my $node = shift;
- foreach my $child
- (@{$node->{'extra'}{'associated_section'}->{'contents'}}) {
+ # If a sectioning command wasn't used in the node, the
+ # associated_section won't be set. This is the case for
+ # "(texinfo)Info Format Preamble" and some other nodes in
+ # doc/texinfo.texi. Avoid referencing it which would create
+ # it by mistake, which would cause problems in Structuring.pm.
+
+ my $contents;
+ if (defined $node->{'extra'}{'associated_section'}) {
+ $contents = $node->{'extra'}{'associated_section'}->{'contents'};
+ } else {
+ $contents = $node->{'contents'};
+ }
+
+
+ foreach my $child (@{$contents}) {
if ($child->{'cmdname'} and $child->{'cmdname'} eq 'menu') {
push @{$node->{'menus'}}, $child;
# Disable - do this in the C code now.
@@ -234,14 +247,14 @@
$tree_stream = qx(./parsetexi $file_name 2>/dev/null);
my ($TREE, $LABELS, $INDEX_NAMES);
- #print "Reading tree...\n";
+ print "Reading tree...\n";
eval $tree_stream;
- #print "Read tree.\n";
+ print "Read tree.\n";
- #print "Adjusting tree...\n";
+ print "Adjusting tree...\n";
_add_parents ($TREE);
_complete_node_list ($self, $TREE);
- #print "Adjusted tree.\n";
+ print "Adjusted tree.\n";
$self->{'info'}->{'input_file_name'} = $file_name;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [6064] parsetexi don't create associated section by mistake,
Gavin D. Smith <=