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/api.c (build_single_ind


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/api.c (build_single_index_data), tp/Texinfo/XS/parsetexi/indices.c (wipe_index, enter_index_entry): store index_ignore_chars as a string already in enter_index_entry.
Date: Sat, 18 Feb 2023 07:24:33 -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 bb2276b1f3 * tp/Texinfo/XS/parsetexi/api.c (build_single_index_data), 
tp/Texinfo/XS/parsetexi/indices.c (wipe_index, enter_index_entry): store 
index_ignore_chars as a string already in enter_index_entry.
bb2276b1f3 is described below

commit bb2276b1f34cfefc36831cc5f08b62c6e24e8499
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Feb 18 13:24:25 2023 +0100

    * tp/Texinfo/XS/parsetexi/api.c (build_single_index_data),
    tp/Texinfo/XS/parsetexi/indices.c (wipe_index, enter_index_entry):
    store index_ignore_chars as a string already in enter_index_entry.
---
 ChangeLog                            |  6 ++++++
 tp/Texinfo/XS/parsetexi/api.c        | 21 +++------------------
 tp/Texinfo/XS/parsetexi/indices.c    | 18 +++++++++++++++++-
 tp/Texinfo/XS/parsetexi/tree_types.h |  2 +-
 4 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 06df234850..73a0c31585 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-02-18  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/api.c (build_single_index_data),
+       tp/Texinfo/XS/parsetexi/indices.c (wipe_index, enter_index_entry):
+       store index_ignore_chars as a string already in enter_index_entry.
+
 2023-02-18  Patrice Dumas  <pertusus@free.fr>
 
        Store index_ignore_chars as a string
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 2ea01c6fdb..03bb5d8b2c 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -900,24 +900,9 @@ build_single_index_data (INDEX *i)
       if (e->node)
         STORE2("entry_node", newRV_inc ((SV *)e->node->hv));
 
-      /* Create ignored_chars string. */
-      {
-        TEXT index_ignore_chars_string;
-        text_init (&index_ignore_chars_string);
-
-        if (e->ignored_chars.backslash)
-          text_append (&index_ignore_chars_string, "\\");
-        if (e->ignored_chars.hyphen)
-          text_append (&index_ignore_chars_string, "-");
-        if (e->ignored_chars.lessthan)
-          text_append (&index_ignore_chars_string, "<");
-        if (e->ignored_chars.atsign)
-          text_append (&index_ignore_chars_string, "@");
-
-        if (index_ignore_chars_string.end > 0)
-          STORE2("index_ignore_chars",
-                 newSVpv_utf8 (index_ignore_chars_string.text, 0));
-      }
+      if (e->ignored_chars.end > 0)
+        STORE2("index_ignore_chars",
+               newSVpv_utf8 (e->ignored_chars.text, 0));
 
       av_push (entries, newRV_inc ((SV *)entry));
       entry_number++;
diff --git a/tp/Texinfo/XS/parsetexi/indices.c 
b/tp/Texinfo/XS/parsetexi/indices.c
index 148e9a5856..2591fc8b15 100644
--- a/tp/Texinfo/XS/parsetexi/indices.c
+++ b/tp/Texinfo/XS/parsetexi/indices.c
@@ -129,6 +129,13 @@ add_index (char *name, int in_code)
 static void
 wipe_index (INDEX *idx)
 {
+  int i;
+  INDEX_ENTRY *ie;
+  for (i = 0; i < idx->index_number; i++)
+    {
+      ie = &idx->index_entries[i];
+      free (ie->ignored_chars.text);
+    }
   free (idx->name);
   free (idx->index_entries);
 }
@@ -282,7 +289,16 @@ enter_index_entry (enum command_id index_type_cmd,
   entry->index_prefix = idx->prefix;
   entry->command = element;
   entry->number = idx->index_number;
-  entry->ignored_chars = global_info.ignored_chars;
+
+  /* Create ignored_chars string. */
+  if (global_info.ignored_chars.backslash)
+    text_append (&(entry->ignored_chars), "\\");
+  if (global_info.ignored_chars.hyphen)
+    text_append (&(entry->ignored_chars), "-");
+  if (global_info.ignored_chars.lessthan)
+    text_append (&(entry->ignored_chars), "<");
+  if (global_info.ignored_chars.atsign)
+    text_append (&(entry->ignored_chars), "@");
 
   if (nesting_context.regions_stack.top > 0)
     entry->region = top_command (&nesting_context.regions_stack);
diff --git a/tp/Texinfo/XS/parsetexi/tree_types.h 
b/tp/Texinfo/XS/parsetexi/tree_types.h
index b99f437fa5..b03af138c4 100644
--- a/tp/Texinfo/XS/parsetexi/tree_types.h
+++ b/tp/Texinfo/XS/parsetexi/tree_types.h
@@ -136,7 +136,7 @@ typedef struct {
     ELEMENT *node;
     int number; /* Index of entry in containing index, 1-based. */
     enum command_id region;
-    IGNORED_CHARS ignored_chars;
+    TEXT ignored_chars;
 } INDEX_ENTRY;
 
 typedef struct INDEX {



reply via email to

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