texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_


From: Patrice Dumas
Subject: branch master updated: * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_protect_*) (_reference_to_text_in_texi, _normalize_texinfo_name, _prepare_anchor), Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_tree) (_fix_texinfo_tree): call Texinfo::Structuring::rebuild_document or Texinfo::Structuring::rebuild_tree to rebuild the tree if modified in XS.
Date: Wed, 25 Oct 2023 03:05:58 -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 ba44f68672 * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_protect_*) 
(_reference_to_text_in_texi, _normalize_texinfo_name, _prepare_anchor), 
Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_tree) (_fix_texinfo_tree): call 
Texinfo::Structuring::rebuild_document or Texinfo::Structuring::rebuild_tree to 
rebuild the tree if modified in XS.
ba44f68672 is described below

commit ba44f68672ac21e34a468d2632b49ca8a275d43b
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Oct 25 09:05:52 2023 +0200

    * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_protect_*)
    (_reference_to_text_in_texi, _normalize_texinfo_name, _prepare_anchor),
    Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_tree)
    (_fix_texinfo_tree): call Texinfo::Structuring::rebuild_document or
    Texinfo::Structuring::rebuild_tree to rebuild the tree if modified in
    XS.
---
 ChangeLog                                    | 9 +++++++++
 Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm | 6 ++++++
 Pod-Simple-Texinfo/pod2texi.pl               | 2 ++
 tp/TODO                                      | 6 +++++-
 4 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 461b4fa2b7..f213069b9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-10-25  Patrice Dumas  <pertusus@free.fr>
+
+       * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_protect_*)
+       (_reference_to_text_in_texi, _normalize_texinfo_name, _prepare_anchor),
+       Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_tree)
+       (_fix_texinfo_tree): call Texinfo::Structuring::rebuild_document or
+       Texinfo::Structuring::rebuild_tree to rebuild the tree if modified in
+       XS.
+
 2023-10-25  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Structuring.pm (sectioning_structure),
diff --git a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm 
b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
index 6f46d3aae9..f315153176 100644
--- a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
+++ b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
@@ -354,6 +354,7 @@ sub _protect_comma($)
   my $texinfo = shift;
   my $tree = parse_texi_line(undef, $texinfo);
   $tree = protect_comma_in_tree($tree);
+  $tree = Texinfo::Structuring::rebuild_tree($tree);
   return Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
 }
 
@@ -362,6 +363,7 @@ sub _protect_colon($)
   my $texinfo = shift;
   my $tree = parse_texi_line(undef, $texinfo);
   $tree = protect_colon_in_tree($tree);
+  $tree = Texinfo::Structuring::rebuild_tree($tree);
   return Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
 }
 
@@ -374,6 +376,7 @@ sub _protect_hashchar($)
     my $document = parse_texi_text(undef, $texinfo);
     my $tree = $document->tree();
     protect_hashchar_at_line_beginning($tree);
+    $tree = Texinfo::Structuring::rebuild_tree($tree);
     return Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
   } else {
     return $texinfo;
@@ -387,6 +390,7 @@ sub _reference_to_text_in_texi($)
   my $document = parse_texi_text(undef, $texinfo);
   my $tree = $document->tree();
   reference_to_arg_in_tree($tree);
+  $tree = Texinfo::Structuring::rebuild_tree($tree);
   return Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
 }
 
@@ -444,6 +448,7 @@ sub _normalize_texinfo_name($$)
   my $tree = $document->tree();
   if ($command eq 'anchor') {
     Texinfo::Transformations::protect_first_parenthesis_in_targets($tree);
+    $tree = Texinfo::Structuring::rebuild_tree($tree);
   }
   my $fixed_text = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
   my $result = $fixed_text;
@@ -496,6 +501,7 @@ sub _prepare_anchor($$)
   }
   $node_tree = protect_comma_in_tree($node_tree);
   $node_tree = protect_colon_in_tree($node_tree);
+  $node_tree = Texinfo::Structuring::rebuild_tree($node_tree);
   $self->{'texinfo_nodes'}->{$normalized} = $node_tree;
   my $final_node_name = 
Texinfo::Convert::Texinfo::convert_to_texinfo($node_tree);
   return $final_node_name;
diff --git a/Pod-Simple-Texinfo/pod2texi.pl b/Pod-Simple-Texinfo/pod2texi.pl
index 4702f60573..b92636f0b3 100755
--- a/Pod-Simple-Texinfo/pod2texi.pl
+++ b/Pod-Simple-Texinfo/pod2texi.pl
@@ -299,6 +299,7 @@ sub _parsed_manual_tree($$$$$)
       my $added_nodes
         = Texinfo::Transformations::insert_nodes_for_sectioning_commands(
                                            $document, $registrar, 
$texi_parser);
+      $document = Texinfo::Structuring::rebuild_document($document);
       if ($self and $self->texinfo_sectioning_base_level() > 0) {
         # prepend the manual name
         foreach my $node (@$added_nodes) {
@@ -389,6 +390,7 @@ sub _fix_texinfo_tree($$$$;$$)
       }
     }
   }
+  $document = Texinfo::Structuring::rebuild_document($document);
   return ($texi_parser, $document);
 }
 
diff --git a/tp/TODO b/tp/TODO
index 8e8f99cdc6..972e417914 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -27,8 +27,12 @@ module, and the _l variants seem to be in glibc but are are 
not in the glibc
 documentation.  According to Eli, if the locale's codeset is UTF-8, glibc
 uses the full Unicode CLDR, which is what we want.
 
+Document that Texinfo::Structuring::rebuild_document or
+Texinfo::Structuring::rebuild_tree should be called after tree modifications
+if the parser is XS but converters are perl.
+
 the code in _parsed_manual_tree in Pod-Simple-Texinfo/pod2texi.pl
-does not work with XS.  See FIXME in the code.  Tested in
+does not work perfectly with XS.  See FIXME in the code.  Tested in
 ./manual_tests/manual_sectioning_gap_test.sh
 Not a priority.
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]