texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/parsetexi/indices.c (enter_index_


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/indices.c (enter_index_entry), tp/Texinfo/XS/parsetexi/api.c (build_single_index_data): store the index_entry extra array directly in enter_index_entry, using extra_misc_args.
Date: Mon, 06 Mar 2023 17:45:06 -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 43c1ca1348 * tp/Texinfo/XS/parsetexi/indices.c (enter_index_entry), 
tp/Texinfo/XS/parsetexi/api.c (build_single_index_data): store the index_entry 
extra array directly in enter_index_entry, using extra_misc_args.
43c1ca1348 is described below

commit 43c1ca1348b68caabe64ec81b1af11e18feeff27
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Mar 6 23:44:55 2023 +0100

    * tp/Texinfo/XS/parsetexi/indices.c (enter_index_entry),
    tp/Texinfo/XS/parsetexi/api.c (build_single_index_data): store the
    index_entry extra array directly in enter_index_entry, using
    extra_misc_args.
---
 ChangeLog                         |  7 +++++++
 tp/Texinfo/XS/parsetexi/api.c     | 11 ++++++-----
 tp/Texinfo/XS/parsetexi/indices.c | 13 +++++++++++++
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dd854f16a0..c18bd55b01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-03-06  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/indices.c (enter_index_entry),
+       tp/Texinfo/XS/parsetexi/api.c (build_single_index_data): store the
+       index_entry extra array directly in enter_index_entry, using
+       extra_misc_args.
+
 2023-03-06  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Common.pm (lookup_index_entry), tp/Texinfo/ParserNonXS.pm
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 0fea9e47ae..bd1d37c0ec 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -805,28 +805,29 @@ build_single_index_data (INDEX *i)
 
       av_push (entries, newRV_inc ((SV *)entry));
 
-      /* We set this now because the index data structures don't
-         exist at the time that the main tree is built. */
+      /*
       {
       SV **extra_hash;
       AV *av;
       extra_hash = hv_fetch (e->command->hv, "extra", strlen ("extra"), 0);
       if (!extra_hash)
-        {
+        {*/
           /* There's no guarantee that the "extra" value was set on
              the element. */
+        /*
           extra_hash = hv_store (e->command->hv, "extra", strlen ("extra"),
                                  newRV_inc ((SV *)newHV ()), 0);
-        }
+        }*/
 
       /* element index_entry extra value is an array reference containing the
          index name and entry number */
+      /*
       av = newAV ();
       av_push (av, newSVpv_utf8 (i->name, 0));
       av_push (av, newSViv (entry_number));
       hv_store ((HV *)SvRV(*extra_hash), "index_entry", strlen ("index_entry"),
                 newRV_inc ((SV *)av), 0);
-      }
+      }*/
       entry_number++;
 #undef STORE2
     }
diff --git a/tp/Texinfo/XS/parsetexi/indices.c 
b/tp/Texinfo/XS/parsetexi/indices.c
index 5c318944f3..10810aab5f 100644
--- a/tp/Texinfo/XS/parsetexi/indices.c
+++ b/tp/Texinfo/XS/parsetexi/indices.c
@@ -300,6 +300,19 @@ enter_index_entry (enum command_id index_type_cmd,
       free (ignored_chars.text);
     }
 
+  /* index_entry is an array with two elements.  Use an element with 
extra_misc_args
+     to pass that information as an array */
+  {
+    ELEMENT *index_entry = new_element (ET_NONE);
+    ELEMENT *e = new_element (ET_NONE);
+    text_append (&e->text, idx->name);
+    add_to_element_contents (index_entry, e);
+    e = new_element (ET_NONE);
+    text_printf (&e->text, "%d", idx->index_number);
+    add_to_element_contents (index_entry, e);
+    add_extra_misc_args (element, "index_entry", index_entry);
+  }
+
   if (nesting_context.regions_stack.top > 0)
     {
       enum command_id region = top_command (&nesting_context.regions_stack);



reply via email to

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