texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Wed, 23 Oct 2024 09:43:05 -0400 (EDT)

branch: master
commit 7dfc1154c72a5b22ce2f7c4c42ff26fb538a66b2
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Oct 23 15:30:30 2024 +0200

    * tp/Texinfo/XS/parsetexi/handle_commands.c,
    tp/Texinfo/XS/parsetexi/parser.c,
    tp/Texinfo/XS/structuring_transfo/transformations.c: use TF_text to
    make sure that the element is a container element when the main
    objective of the code is to be able to access CONTAINER fields instead
    of TF_at_command.
---
 ChangeLog                                           |  9 +++++++++
 tp/Texinfo/XS/convert/convert_html.c                |  6 +++++-
 tp/Texinfo/XS/parsetexi/handle_commands.c           |  2 +-
 tp/Texinfo/XS/parsetexi/parser.c                    |  3 ++-
 tp/Texinfo/XS/structuring_transfo/transformations.c | 10 +++++-----
 5 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2e46b1fc44..326b470516 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,15 @@
 
        * tp/Texinfo/XS/main/tree_types.h: add a comment
 
+2024-10-23  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/handle_commands.c,
+       tp/Texinfo/XS/parsetexi/parser.c,
+       tp/Texinfo/XS/structuring_transfo/transformations.c: use TF_text to
+       make sure that the element is a container element when the main
+       objective of the code is to be able to access CONTAINER fields instead
+       of TF_at_command.
+
 2024-10-23  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/element_types.awk: do not set flags that are
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index 81e1f4e2e7..aeb991e47b 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -1219,7 +1219,11 @@ html_convert_tree_append (CONVERTER *self, const ELEMENT 
*element,
   if ((element->type
        && (self->current_types_conversion_function[element->type].status
                                                      == FRS_status_ignored
-         /* type unknown in Perl */
+         /* type unknown in Perl
+            FIXME in which situation is that possible?  The type has to
+            be known in Perl for the formatting function to be set to
+            be ignored?
+          */
            || (type_data[element->type].flags & TF_at_command
                && element->type != ET_index_entry_command
                && element->type != ET_definfoenclose_command)))
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c 
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index 707d896eb0..8baba6286b 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -91,7 +91,7 @@ check_no_text (const ELEMENT *current)
                    && g->e.text->text[strspn 
                                        (g->e.text->text, whitespace_chars)])
                   /* empty_line text is possible */
-                  || (type_data[g->type].flags & TF_at_command
+                  || (!(type_data[g->type].flags & TF_text)
                       && g->e.c->cmd != CM_c
                       && g->e.c->cmd != CM_comment
                       && g->type != ET_index_entry_command))
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 9cc8c845d4..f065fda646 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -600,7 +600,8 @@ begin_paragraph (ELEMENT *current)
           if (child->type == ET_empty_line
               || child->type == ET_paragraph)
             break;
-          if (type_data[child->type].flags & TF_at_command
+          if (!(type_data[child->type].flags & TF_text)
+              && child->e.c->cmd
               && command_data(child->e.c->cmd).flags & CF_close_paragraph)
             break;
           /* after an indent there are ignorable_spaces_after_command
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c 
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index bebb2d1439..90495510a4 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -435,7 +435,7 @@ relate_index_entries_to_table_items_internal (const char 
*type,
                                               ELEMENT *current,
                                               void *argument)
 {
-  if (type_data[current->type].flags & TF_at_command
+  if (!(type_data[current->type].flags & TF_text)
       && current->e.c->cmd == CM_table)
     {
       INDEX_LIST *indices_info = (INDEX_LIST *)argument;
@@ -542,7 +542,7 @@ move_index_entries_after_items_internal (const char *type,
                                          ELEMENT *current,
                                          void *argument)
 {
-  if (type_data[current->type].flags & TF_at_command
+  if (!(type_data[current->type].flags & TF_text)
       && (current->e.c->cmd == CM_enumerate
           || current->e.c->cmd == CM_itemize))
     {
@@ -703,7 +703,7 @@ reassociate_to_node (const char *type, ELEMENT *current, 
void *argument)
   ELEMENT *added_node = new_previous->list[0];
   ELEMENT *previous_node = new_previous->list[1];
 
-  if (type_data[current->type].flags & TF_at_command
+  if (!(type_data[current->type].flags & TF_text)
       && current->e.c->cmd == CM_menu)
     {
       CONST_ELEMENT_LIST *added_node_menus;
@@ -867,7 +867,7 @@ reference_to_arg_internal (const char *type,
                            ELEMENT *e,
                            void *argument)
 {
-  if (type_data[e->type].flags & TF_at_command
+  if (!(type_data[e->type].flags & TF_text) && e->e.c->cmd
       && builtin_command_data[e->e.c->cmd].flags & CF_ref)
     {
       DOCUMENT *document = (DOCUMENT *) argument;
@@ -1507,7 +1507,7 @@ protect_first_parenthesis_in_targets_internal (const char 
*type,
                                                void *argument)
 {
   ELEMENT *element_label;
-  if (!(type_data[current->type].flags & TF_at_command))
+  if (type_data[current->type].flags & TF_text)
     return 0;
 
   element_label = get_label_element (current);



reply via email to

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