[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/ParserNonXS.pm (_register_extra_menu
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/ParserNonXS.pm (_register_extra_menu_entry_information) (_enter_menu_entry_node), tp/Texinfo/Structuring.pm (associate_internal_references), tp/Texinfo/XS/parsetexi/menus.c (register_extra_menu_entry_information, enter_menu_entry_node): put menu_entry_node in internal_references instead of menu_entry. |
Date: |
Mon, 27 Feb 2023 07:06:35 -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 c3aa6eb525 * tp/Texinfo/ParserNonXS.pm
(_register_extra_menu_entry_information) (_enter_menu_entry_node),
tp/Texinfo/Structuring.pm (associate_internal_references),
tp/Texinfo/XS/parsetexi/menus.c (register_extra_menu_entry_information,
enter_menu_entry_node): put menu_entry_node in internal_references instead of
menu_entry.
c3aa6eb525 is described below
commit c3aa6eb52537025413916ca0de4143486e6a5c26
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Feb 27 13:06:24 2023 +0100
* tp/Texinfo/ParserNonXS.pm (_register_extra_menu_entry_information)
(_enter_menu_entry_node), tp/Texinfo/Structuring.pm
(associate_internal_references), tp/Texinfo/XS/parsetexi/menus.c
(register_extra_menu_entry_information, enter_menu_entry_node):
put menu_entry_node in internal_references instead of menu_entry.
---
ChangeLog | 8 ++++++++
tp/Texinfo/ParserNonXS.pm | 13 ++++++++++---
tp/Texinfo/Structuring.pm | 19 +++++++------------
tp/Texinfo/XS/parsetexi/menus.c | 15 +++++++++++----
4 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index be1378ea53..3b382fb511 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-02-27 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/ParserNonXS.pm (_register_extra_menu_entry_information)
+ (_enter_menu_entry_node), tp/Texinfo/Structuring.pm
+ (associate_internal_references), tp/Texinfo/XS/parsetexi/menus.c
+ (register_extra_menu_entry_information, enter_menu_entry_node):
+ put menu_entry_node in internal_references instead of menu_entry.
+
2023-02-27 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Common.pm (_copy_tree, _substitute_references),
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 27b71cfcd3..b7b5bad86a 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -4426,6 +4426,7 @@ sub _register_extra_menu_entry_information($$;$)
{
my ($self, $current, $source_info) = @_;
+ my $menu_entry_node;
foreach my $arg (@{$current->{'contents'}}) {
if ($arg->{'type'} eq 'menu_entry_name') {
if (not $arg->{'contents'} or scalar(@{$arg->{'contents'}}) == 0) {
@@ -4440,6 +4441,7 @@ sub _register_extra_menu_entry_information($$;$)
$self->_line_error(__("empty node name in menu entry"),
$source_info);
}
} else {
+ $menu_entry_node = $arg;
my $parsed_entry_node = _parse_node_manual($arg);
if (defined($parsed_entry_node)) {
foreach my $label_info (keys(%$parsed_entry_node)) {
@@ -4454,18 +4456,23 @@ sub _register_extra_menu_entry_information($$;$)
}
}
}
+ return $menu_entry_node;
}
sub _enter_menu_entry_node($$$)
{
my ($self, $current, $source_info) = @_;
+ $current->{'source_info'} = $source_info;
+
+ my $menu_entry_node
+ = _register_extra_menu_entry_information($self, $current, $source_info);
+ push @{$self->{'internal_references'}}, $menu_entry_node
+ if (defined($menu_entry_node));
+
my $description = { 'type' => 'menu_entry_description',
'parent' => $current };
push @{$current->{'contents'}}, $description;
- _register_extra_menu_entry_information($self, $current, $source_info);
- $current->{'source_info'} = $source_info;
- push @{$self->{'internal_references'}}, $current;
$current = $description;
push @{$current->{'contents'}}, {'type' => 'preformatted',
diff --git a/tp/Texinfo/Structuring.pm b/tp/Texinfo/Structuring.pm
index f79104c4ac..0ae607f900 100644
--- a/tp/Texinfo/Structuring.pm
+++ b/tp/Texinfo/Structuring.pm
@@ -1490,18 +1490,13 @@ sub associate_internal_references($$$$$)
return if (!defined($refs));
foreach my $ref (@$refs) {
my $node_arg;
- if ($ref->{'type'} and $ref->{'type'} eq 'menu_entry') {
- foreach my $arg (@{$ref->{'contents'}}) {
- if ($arg->{'type'} eq 'menu_entry_node') {
- if ($arg->{'extra'} and $arg->{'extra'}->{'node_content'}) {
- my $normalized =
- Texinfo::Convert::NodeNameNormalization::normalize_node(
- {'contents' => $arg->{'extra'}->{'node_content'} });
- $arg->{'extra'}->{'normalized'} = $normalized
- if (defined $normalized and $normalized ne '');
- }
- last;
- }
+ if ($ref->{'type'} and $ref->{'type'} eq 'menu_entry_node') {
+ if ($ref->{'extra'} and $ref->{'extra'}->{'node_content'}) {
+ my $normalized =
+ Texinfo::Convert::NodeNameNormalization::normalize_node(
+ {'contents' => $ref->{'extra'}->{'node_content'} });
+ $ref->{'extra'}->{'normalized'} = $normalized
+ if (defined $normalized and $normalized ne '');
}
next;
}
diff --git a/tp/Texinfo/XS/parsetexi/menus.c b/tp/Texinfo/XS/parsetexi/menus.c
index df63a798a1..1292baf410 100644
--- a/tp/Texinfo/XS/parsetexi/menus.c
+++ b/tp/Texinfo/XS/parsetexi/menus.c
@@ -26,10 +26,11 @@
#include "source_marks.h"
/* Save 'menu_entry_node' extra keys. */
-void
+ELEMENT *
register_extra_menu_entry_information (ELEMENT *current)
{
int i;
+ ELEMENT *menu_entry_node = 0;
for (i = 0; i < current->contents.number; i++)
{
@@ -59,6 +60,7 @@ register_extra_menu_entry_information (ELEMENT *current)
}
else
{
+ menu_entry_node = arg;
if (parsed_entry_node->node_content)
add_extra_contents (arg, "node_content",
parsed_entry_node->node_content);
@@ -69,6 +71,7 @@ register_extra_menu_entry_information (ELEMENT *current)
free (parsed_entry_node);
}
}
+ return menu_entry_node;
}
/* Process the destination of the menu entry, and start a menu entry
@@ -77,12 +80,16 @@ ELEMENT *
enter_menu_entry_node (ELEMENT *current)
{
ELEMENT *description, *preformatted;
+ ELEMENT *menu_entry_node;
+
+ current->source_info = current_source_info;
+
+ menu_entry_node = register_extra_menu_entry_information (current);
+ if (menu_entry_node)
+ remember_internal_xref (menu_entry_node);
description = new_element (ET_menu_entry_description);
add_to_element_contents (current, description);
- register_extra_menu_entry_information (current);
- current->source_info = current_source_info;
- remember_internal_xref (current);
current = description;
preformatted = new_element (ET_preformatted);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/ParserNonXS.pm (_register_extra_menu_entry_information) (_enter_menu_entry_node), tp/Texinfo/Structuring.pm (associate_internal_references), tp/Texinfo/XS/parsetexi/menus.c (register_extra_menu_entry_information, enter_menu_entry_node): put menu_entry_node in internal_references instead of menu_entry.,
Patrice Dumas <=
- Prev by Date:
branch master updated: * tp/Texinfo/Common.pm (_copy_tree, _substitute_references), tp/Texinfo/Convert/HTML.pm (_convert_menu_entry_type), tp/Texinfo/ParserNonXS.pm (_register_extra_menu_entry_information), tp/Texinfo/Structuring.pm (_check_menu_entry) (set_menus_node_directions, associate_internal_references) (new_node_menu_entry), tp/Texinfo/Transformations.pm (_normalized_entry_associated_internal_node), tp/Texinfo/XS/parsetexi/menus.c (register_extra_menu_entry_information): put node_content and node_manual [...]
- Next by Date:
branch master updated: * tp/Texinfo/Convert/DocBook.pm (_convert), tp/Texinfo/Convert/HTML.pm (_convert_xref_commands), tp/Texinfo/Convert/LaTeX.pm (_convert), tp/Texinfo/Convert/TexinfoMarkup.pm (_convert), tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line), tp/Texinfo/Structuring.pm (check_nodes_are_referenced) (associate_internal_references), tp/Texinfo/XS/parsetexi/separator.c (handle_close_brace), tp/Texinfo/XS/parsetexi/tree.c (destroy_associated_info), tp/Texinfo/XS/parsetexi/api.c (build_node_spec, s [...]
- Previous by thread:
branch master updated: * tp/Texinfo/Common.pm (_copy_tree, _substitute_references), tp/Texinfo/Convert/HTML.pm (_convert_menu_entry_type), tp/Texinfo/ParserNonXS.pm (_register_extra_menu_entry_information), tp/Texinfo/Structuring.pm (_check_menu_entry) (set_menus_node_directions, associate_internal_references) (new_node_menu_entry), tp/Texinfo/Transformations.pm (_normalized_entry_associated_internal_node), tp/Texinfo/XS/parsetexi/menus.c (register_extra_menu_entry_information): put node_content and node_manual [...]
- Next by thread:
branch master updated: * tp/Texinfo/Convert/DocBook.pm (_convert), tp/Texinfo/Convert/HTML.pm (_convert_xref_commands), tp/Texinfo/Convert/LaTeX.pm (_convert), tp/Texinfo/Convert/TexinfoMarkup.pm (_convert), tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line), tp/Texinfo/Structuring.pm (check_nodes_are_referenced) (associate_internal_references), tp/Texinfo/XS/parsetexi/separator.c (handle_close_brace), tp/Texinfo/XS/parsetexi/tree.c (destroy_associated_info), tp/Texinfo/XS/parsetexi/api.c (build_node_spec, s [...]
- Index(es):