[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm, t
From: |
Patrice Dumas |
Subject: |
branch master updated: * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm, tp/t/automatic_menus.t, tp/t/convert_to_text.t, tp/t/index_before_item.t, tp/t/reference_to_text_in_tree.t, tp/t/test_fill_gaps_in_sectioning.t, tp/t/test_tree_copy.t: call tree() to rebuild the tree from a document instead of using Texinfo::Document::rebuild_tree. |
Date: |
Mon, 11 Mar 2024 07:15:33 -0400 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 8af06cb066 * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm,
tp/t/automatic_menus.t, tp/t/convert_to_text.t, tp/t/index_before_item.t,
tp/t/reference_to_text_in_tree.t, tp/t/test_fill_gaps_in_sectioning.t,
tp/t/test_tree_copy.t: call tree() to rebuild the tree from a document instead
of using Texinfo::Document::rebuild_tree.
8af06cb066 is described below
commit 8af06cb066277d41228830e60fc262364551079c
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Mar 11 12:15:30 2024 +0100
* Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm,
tp/t/automatic_menus.t, tp/t/convert_to_text.t,
tp/t/index_before_item.t, tp/t/reference_to_text_in_tree.t,
tp/t/test_fill_gaps_in_sectioning.t, tp/t/test_tree_copy.t: call
tree() to rebuild the tree from a document instead of using
Texinfo::Document::rebuild_tree.
* Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm: do not return the tree
when its root is a container and is not modified by transformations.
Use parse_texi_piece instead of parse_texi_text for pieces of Texinfo.
---
ChangeLog | 13 +++++++++++++
Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm | 25 +++++++++++++------------
tp/t/automatic_menus.t | 3 ++-
tp/t/convert_to_text.t | 3 ++-
tp/t/index_before_item.t | 3 ++-
tp/t/protect_character_in_texinfo.t | 2 +-
tp/t/reference_to_text_in_tree.t | 3 ++-
tp/t/test_fill_gaps_in_sectioning.t | 3 ++-
tp/t/test_protect_contents.t | 3 ++-
tp/t/test_tree_copy.t | 4 ++--
10 files changed, 41 insertions(+), 21 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a09f37b7f9..b18568ca9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2024-03-11 Patrice Dumas <pertusus@free.fr>
+
+ * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm,
+ tp/t/automatic_menus.t, tp/t/convert_to_text.t,
+ tp/t/index_before_item.t, tp/t/reference_to_text_in_tree.t,
+ tp/t/test_fill_gaps_in_sectioning.t, tp/t/test_tree_copy.t: call
+ tree() to rebuild the tree from a document instead of using
+ Texinfo::Document::rebuild_tree.
+
+ * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm: do not return the tree
+ when its root is a container and is not modified by transformations.
+ Use parse_texi_piece instead of parse_texi_text for pieces of Texinfo.
+
2024-03-10 Patrice Dumas <pertusus@free.fr>
* Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_tree)
diff --git a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
index c008dfd428..2657b06e3a 100644
--- a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
+++ b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
@@ -49,7 +49,7 @@ use Pod::Simple::PullParser ();
#use Pod::ParseLink;
use Texinfo::Convert::NodeNameNormalization qw(convert_to_identifier);
-use Texinfo::Parser qw(parse_texi_line parse_texi_text);
+use Texinfo::Parser qw(parse_texi_line parse_texi_piece);
use Texinfo::Convert::Texinfo;
use Texinfo::Convert::TextContent;
use Texinfo::Common qw(protect_colon_in_tree protect_comma_in_tree
@@ -354,7 +354,7 @@ sub _protect_comma($)
{
my $texinfo = shift;
my $tree = parse_texi_line(undef, $texinfo);
- $tree = protect_comma_in_tree($tree);
+ protect_comma_in_tree($tree);
$tree = Texinfo::Document::rebuild_tree($tree);
return Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
}
@@ -363,7 +363,7 @@ sub _protect_colon($)
{
my $texinfo = shift;
my $tree = parse_texi_line(undef, $texinfo);
- $tree = protect_colon_in_tree($tree);
+ protect_colon_in_tree($tree);
$tree = Texinfo::Document::rebuild_tree($tree);
return Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
}
@@ -373,11 +373,11 @@ sub _protect_hashchar($)
my $texinfo = shift;
# protect # first in line
if ($texinfo =~ /#/) {
- # FIXME use parse_texi_piece?
- my $document = parse_texi_text(undef, $texinfo);
+ my $document = parse_texi_piece(undef, $texinfo);
my $tree = $document->tree();
protect_hashchar_at_line_beginning($tree);
- $tree = Texinfo::Document::rebuild_tree($tree);
+ # rebuild the tree
+ $tree = $document->tree();
return Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
} else {
return $texinfo;
@@ -387,11 +387,11 @@ sub _protect_hashchar($)
sub _reference_to_text_in_texi($)
{
my $texinfo = shift;
- # FIXME use parse_texi_piece?
- my $document = parse_texi_text(undef, $texinfo);
+ my $document = parse_texi_piece(undef, $texinfo);
my $tree = $document->tree();
reference_to_arg_in_tree($tree);
- $tree = Texinfo::Document::rebuild_tree($tree);
+ # rebuild the tree
+ $tree = $document->tree();
return Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
}
@@ -448,7 +448,8 @@ sub _normalize_texinfo_name($$)
my $tree = $document->tree();
if ($command eq 'anchor') {
Texinfo::Transformations::protect_first_parenthesis_in_targets($tree);
- $tree = Texinfo::Document::rebuild_tree($tree);
+ # rebuild the tree
+ $tree = $document->tree();
}
my $fixed_text = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
my $result = $fixed_text;
@@ -499,8 +500,8 @@ sub _prepare_anchor($$)
$texinfo_node_name = "$node $number_appended";
$node_tree = parse_texi_line(undef, $texinfo_node_name);
}
- $node_tree = protect_comma_in_tree($node_tree);
- $node_tree = protect_colon_in_tree($node_tree);
+ protect_comma_in_tree($node_tree);
+ protect_colon_in_tree($node_tree);
$node_tree = Texinfo::Document::rebuild_tree($node_tree);
$self->{'texinfo_nodes'}->{$normalized} = $node_tree;
my $final_node_name =
Texinfo::Convert::Texinfo::convert_to_texinfo($node_tree);
diff --git a/tp/t/automatic_menus.t b/tp/t/automatic_menus.t
index 4a667cb639..42acb0435a 100644
--- a/tp/t/automatic_menus.t
+++ b/tp/t/automatic_menus.t
@@ -39,7 +39,8 @@ sub test($$$;$$)
Texinfo::Transformations::complete_tree_nodes_menus($tree, $use_sections);
}
- $tree = Texinfo::Document::rebuild_tree($tree);
+ # rebuild the tree
+ $tree = $document->tree();
my $texi_result = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
diff --git a/tp/t/convert_to_text.t b/tp/t/convert_to_text.t
index a800b94a94..c2e2444a4f 100644
--- a/tp/t/convert_to_text.t
+++ b/tp/t/convert_to_text.t
@@ -81,7 +81,8 @@ if ($sections_list) {
Texinfo::Document::register_document_sections_list($document,
$sections_list);
}
-$tree = Texinfo::Document::rebuild_tree($tree);
+# rebuild the tree
+$tree = $document->tree();
# a converter only used for translation in text conversion, not
# to convert anything.
diff --git a/tp/t/index_before_item.t b/tp/t/index_before_item.t
index be0b71a0e9..936698e3b7 100644
--- a/tp/t/index_before_item.t
+++ b/tp/t/index_before_item.t
@@ -27,7 +27,8 @@ sub run_test($$$)
#print STDERR Texinfo::DebugTree::convert_tree(undef, $tree)."\n";
move_index_entries_after_items_in_tree($tree);
- $tree = Texinfo::Document::rebuild_tree($tree);
+ # rebuild tree
+ $tree = $document->tree();
my $texi_result = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
diff --git a/tp/t/protect_character_in_texinfo.t
b/tp/t/protect_character_in_texinfo.t
index d2039f8bc9..9df2d7ffa5 100644
--- a/tp/t/protect_character_in_texinfo.t
+++ b/tp/t/protect_character_in_texinfo.t
@@ -52,7 +52,7 @@ sub run_test($$$$)
}
}
- #Texinfo::Document::rebuild_document($document);
+ # rebuild tree
$tree_as_text = $document->tree();
$tree_as_line = Texinfo::Document::rebuild_tree($tree_as_line);
diff --git a/tp/t/reference_to_text_in_tree.t b/tp/t/reference_to_text_in_tree.t
index 2cb40fca40..7c637d1598 100644
--- a/tp/t/reference_to_text_in_tree.t
+++ b/tp/t/reference_to_text_in_tree.t
@@ -25,7 +25,8 @@ sub run_test($$$)
my $tree = $document->tree();
Texinfo::Transformations::reference_to_arg_in_tree($tree);
- $tree = Texinfo::Document::rebuild_tree($tree);
+ # rebuild tree
+ $tree = $document->tree();
my $texi_result = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
diff --git a/tp/t/test_fill_gaps_in_sectioning.t
b/tp/t/test_fill_gaps_in_sectioning.t
index d6c2ef765a..4fffc8c266 100644
--- a/tp/t/test_fill_gaps_in_sectioning.t
+++ b/tp/t/test_fill_gaps_in_sectioning.t
@@ -41,7 +41,8 @@ sub test_correction($$$;$)
$test_correct_level);
}
- $tree = Texinfo::Document::rebuild_tree($tree);
+ # rebuild the tree
+ $tree = $document->tree();
{
local $Data::Dumper::Purity = 1;
#local $Data::Dumper::Maxdepth = 2;
diff --git a/tp/t/test_protect_contents.t b/tp/t/test_protect_contents.t
index 9e7766f697..f055b8306a 100644
--- a/tp/t/test_protect_contents.t
+++ b/tp/t/test_protect_contents.t
@@ -29,7 +29,8 @@ sub run_test($$$$)
if ($do->{'protect_first_parenthesis'}) {
Texinfo::Transformations::protect_first_parenthesis_in_targets($tree);
- $tree = Texinfo::Document::rebuild_tree($tree);
+ # rebuild tree
+ $tree = $document->tree();
$texi_result
= Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
diff --git a/tp/t/test_tree_copy.t b/tp/t/test_tree_copy.t
index 602c969f3f..c9d1ab80af 100644
--- a/tp/t/test_tree_copy.t
+++ b/tp/t/test_tree_copy.t
@@ -149,8 +149,8 @@ is ($texi_copy, $texi_tree, "tree and copy to texi match");
# set sectioning structure and redo a copy
Texinfo::Structuring::sectioning_structure($document,
$test_parser);
-
-$tree = Texinfo::Document::rebuild_tree($tree);
+# rebuild the tree
+$tree = $document->tree();
my $copy_with_sec = Texinfo::Common::copy_tree($tree);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm, tp/t/automatic_menus.t, tp/t/convert_to_text.t, tp/t/index_before_item.t, tp/t/reference_to_text_in_tree.t, tp/t/test_fill_gaps_in_sectioning.t, tp/t/test_tree_copy.t: call tree() to rebuild the tree from a document instead of using Texinfo::Document::rebuild_tree.,
Patrice Dumas <=