[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_
From: |
Patrice Dumas |
Subject: |
branch master updated: * Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_tree): modify code to avoid using separately contents and elements clarify what is actually done. Update information in FIXME comment. |
Date: |
Sun, 26 Nov 2023 13:29:39 -0500 |
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 c211f9783d * Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_tree):
modify code to avoid using separately contents and elements clarify what is
actually done. Update information in FIXME comment.
c211f9783d is described below
commit c211f9783dca00a68f2a7dfbf32ad2def1fe0ecc
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 26 19:27:27 2023 +0100
* Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_tree): modify code to
avoid using separately contents and elements clarify what is actually
done. Update information in FIXME comment.
---
ChangeLog | 6 +++++
Pod-Simple-Texinfo/pod2texi.pl | 28 ++++++++++++----------
tp/Texinfo/XS/main/DocumentXS.xs | 3 ++-
.../XS/structuring_transfo/StructuringTransfoXS.xs | 3 +--
4 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 77fb387e4a..fd3e0eed20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,12 @@
formatter, not just for "paragraph" formatters. Do not output
an extra end of line afterwards.
+2023-11-26 Patrice Dumas <pertusus@free.fr>
+
+ * Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_tree): modify code to
+ avoid using separately contents and elements clarify what is actually
+ done. Update information in FIXME comment.
+
2023-11-26 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/ParagraphNonXS.pm: remove a FIXME comment fixed.
diff --git a/Pod-Simple-Texinfo/pod2texi.pl b/Pod-Simple-Texinfo/pod2texi.pl
index f4531f784a..bc54e401ac 100755
--- a/Pod-Simple-Texinfo/pod2texi.pl
+++ b/Pod-Simple-Texinfo/pod2texi.pl
@@ -296,10 +296,14 @@ sub _parsed_manual_tree($$$$$)
# there should already be nodes associated with other sections. Therefore
# new nodes should only be created for the added sections.
if ($section_nodes) {
- # FIXME the following code does not work when using XS code only
- # as $added_nodes is undef. There are other issues, the entries
- # deleted in identifier_target are not deleted in XS, and more generally
- # the code is done as if everything was done with pure perl code.
+ # FIXME the following code does not work when using XS code only:
+ # * $added_nodes is undef. Could be modified.
+ # * the entries deleted in identifier_target are not deleted in XS.
+ # Important?
+ # * the perl tree is directly modified to change the first node argument.
+ # No clear way to add to XS. Would need a way to add an API to modify
+ # a node name, but it is not generally useful.
+ # * Texinfo::Document::register_label_element has no XS override
my $added_nodes
= Texinfo::Transformations::insert_nodes_for_sectioning_commands(
$document, $registrar,
$texi_parser);
@@ -313,7 +317,7 @@ sub _parsed_manual_tree($$$$$)
# prepare the new node Texinfo name and parse it to a Texinfo tree
my $node_texi = Texinfo::Convert::Texinfo::convert_to_texinfo(
- {'contents' => $node->{'args'}->[0]->{'contents'}});
+ $node->{'args'}->[0]);
# We could have kept the asis, too, it is kept when !section_nodes
$node_texi =~ s/^\s*(\@asis\{\})?\s*//;
# complete with manual name
@@ -322,17 +326,15 @@ sub _parsed_manual_tree($$$$$)
my $complete_node_name = $self->_node_name($node_texi);
my $completed_node_tree
= Texinfo::Parser::parse_texi_line(undef, $complete_node_name);
-
# now recreate node arg
- my $node_arg = $node->{'args'}->[0];
- $node_arg->{'contents'} = $completed_node_tree->{'contents'};
- foreach my $content (@{$node_arg->{'contents'}}) {
- $content->{'parent'} = $node_arg;
- }
+ $completed_node_tree->{'type'} = 'line_arg';
+ $completed_node_tree->{'info'} = {'spaces_after_argument'
+ => {'text' => "\n"}};
+ $node->{'args'}->[0] = $completed_node_tree;
my $normalized_node_name
- = Texinfo::Convert::NodeNameNormalization::convert_to_identifier(
- { 'contents' => $node_arg->{'contents'} });
+ = Texinfo::Convert::NodeNameNormalization::convert_to_identifier(
+ $completed_node_tree);
$node->{'extra'}->{'normalized'} = $normalized_node_name;
Texinfo::Document::register_label_element($document, $node,
diff --git a/tp/Texinfo/XS/main/DocumentXS.xs b/tp/Texinfo/XS/main/DocumentXS.xs
index fa098d38a1..cccd93776f 100644
--- a/tp/Texinfo/XS/main/DocumentXS.xs
+++ b/tp/Texinfo/XS/main/DocumentXS.xs
@@ -176,7 +176,8 @@ set_document_options (SV *sv_options_in, SV *document_in)
register_document_options (document, options);
}
-# Next correspond to misc XS interfaces that have no associated
+
+# Next correspond to XS interfaces that have no associated
# .xs file.
diff --git a/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
b/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
index a72fdf8873..944c4b4102 100644
--- a/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
+++ b/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
@@ -257,8 +257,7 @@ regenerate_master_menu (SV *document_in, SV
*customization_information, SV *use_
if (document)
regenerate_master_menu (document, use_sections);
-# The perl function returns the list of added nodes. It is better
-# to reserve the return value for a return status, if it becomes needed.
+# The perl function returns the list of added nodes.
# FIXME the added nodes return value is used in pod2texi
void
insert_nodes_for_sectioning_commands (SV *document_in, ...)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * Pod-Simple-Texinfo/pod2texi.pl (_parsed_manual_tree): modify code to avoid using separately contents and elements clarify what is actually done. Update information in FIXME comment.,
Patrice Dumas <=