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 (store_additional


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/api.c (store_additional_info) (element_to_perl_hash), tp/Texinfo/XS/parsetexi/end_line.c (end_line_starting_block), tp/Texinfo/XS/parsetexi/extra.c (add_associated_info_key, lookup_extra), tp/Texinfo/XS/parsetexi/tree.c (new_associated_info, new_element) (destroy_associated_info, destroy_element), tp/Texinfo/XS/parsetexi/tree_types.h (ASSOCIATED_INFO): instead of putting the extra array, the number and space directly in the element, use a specific structure, ASSOC [...]
Date: Tue, 15 Nov 2022 16:43:09 -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 955ee49cac * tp/Texinfo/XS/parsetexi/api.c (store_additional_info) 
(element_to_perl_hash), tp/Texinfo/XS/parsetexi/end_line.c 
(end_line_starting_block), tp/Texinfo/XS/parsetexi/extra.c 
(add_associated_info_key, lookup_extra), tp/Texinfo/XS/parsetexi/tree.c 
(new_associated_info, new_element) (destroy_associated_info, destroy_element), 
tp/Texinfo/XS/parsetexi/tree_types.h (ASSOCIATED_INFO): instead of putting the 
extra array, the number and space directly in the element, use a spec [...]
955ee49cac is described below

commit 955ee49cace22d1eb0a7b81947ebe4ded58a4b15
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Nov 15 22:40:05 2022 +0100

    * tp/Texinfo/XS/parsetexi/api.c (store_additional_info)
    (element_to_perl_hash), tp/Texinfo/XS/parsetexi/end_line.c
    (end_line_starting_block), tp/Texinfo/XS/parsetexi/extra.c
    (add_associated_info_key, lookup_extra),
    tp/Texinfo/XS/parsetexi/tree.c (new_associated_info, new_element)
    (destroy_associated_info, destroy_element),
    tp/Texinfo/XS/parsetexi/tree_types.h (ASSOCIATED_INFO): instead of
    putting the extra array, the number and space directly in the
    element, use a specific structure, ASSOCIATED_INFO to hold those
    three fields.  Replace add_extra_key by add_associated_info_key
    to associate information.  Add initialization, destruction,
    lookup based on the previous code associated to extra.
---
 ChangeLog                            |  15 ++++
 tp/Texinfo/ParserNonXS.pm            |   2 +
 tp/Texinfo/XS/parsetexi/api.c        | 168 ++++++++++++++++++-----------------
 tp/Texinfo/XS/parsetexi/end_line.c   |   4 +-
 tp/Texinfo/XS/parsetexi/extra.c      |  69 +++++++-------
 tp/Texinfo/XS/parsetexi/tree.c       |  64 ++++++++-----
 tp/Texinfo/XS/parsetexi/tree.h       |   1 +
 tp/Texinfo/XS/parsetexi/tree_types.h |  10 ++-
 8 files changed, 197 insertions(+), 136 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 239189e06b..9730b98f6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2022-11-15  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/api.c (store_additional_info)
+       (element_to_perl_hash), tp/Texinfo/XS/parsetexi/end_line.c
+       (end_line_starting_block), tp/Texinfo/XS/parsetexi/extra.c
+       (add_associated_info_key, lookup_extra),
+       tp/Texinfo/XS/parsetexi/tree.c (new_associated_info, new_element)
+       (destroy_associated_info, destroy_element),
+       tp/Texinfo/XS/parsetexi/tree_types.h (ASSOCIATED_INFO): instead of
+       putting the extra array, the number and space directly in the
+       element, use a specific structure, ASSOCIATED_INFO to hold those
+       three fields.  Replace add_extra_key by add_associated_info_key
+       to associate information.  Add initialization, destruction,
+       lookup based on the previous code associated to extra.
+
 2022-11-15  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * configure.ac: Use absolute path for checking for
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 055c0c6094..79a25da5a9 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -3103,6 +3103,8 @@ sub _end_line($$$)
       my @prototype_row;
       foreach my $content (@{$current->{'contents'}}) {
         if ($content->{'type'} and $content->{'type'} eq 'bracketed') {
+          # TODO the 'extra' information in $content is not copied over,
+          # at least leading/trailing spaces (something else?).
           my $bracketed_prototype
             = { 'type' => 'bracketed_multitable_prototype' };
           $bracketed_prototype->{'contents'} = $content->{'contents'}
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 8066dcad0c..048f0d472c 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -319,101 +319,29 @@ newSVpv_utf8 (char *str, STRLEN len)
   return sv;
 }
 
-/* Set E->hv and 'hv' on E's descendants.  e->parent->hv is assumed
-   to already exist. */
 static void
-element_to_perl_hash (ELEMENT *e)
+store_additional_info (ELEMENT *e, ASSOCIATED_INFO* a, char *key)
 {
-  SV *sv;
-
   dTHX;
 
-  /* e->hv may already exist if there was an extra value elsewhere
-     referring to e. */
-  if (!e->hv)
-    {
-      e->hv = newHV ();
-    }
-
-  if (e->parent)
-    {
-      if (!e->parent->hv)
-        e->parent->hv = newHV ();
-      sv = newRV_inc ((SV *) e->parent->hv);
-      hv_store (e->hv, "parent", strlen ("parent"), sv, 0);
-    }
-
-  if (e->type)
-    {
-      sv = newSVpv (element_type_names[e->type], 0);
-      hv_store (e->hv, "type", strlen ("type"), sv, 0);
-    }
-
-  if (e->cmd)
-    {
-      sv = newSVpv (command_name(e->cmd), 0);
-      hv_store (e->hv, "cmdname", strlen ("cmdname"), sv, 0);
-
-      /* Note we could optimize the call to newSVpv here and
-         elsewhere by passing an appropriate second argument. */
-    }
-
-  if (e->contents.number > 0)
-    {
-      AV *av;
-      int i;
-
-      av = newAV ();
-      sv = newRV_inc ((SV *) av);
-      hv_store (e->hv, "contents", strlen ("contents"), sv, 0);
-      for (i = 0; i < e->contents.number; i++)
-        {
-          element_to_perl_hash (e->contents.list[i]);
-          sv = newRV_inc ((SV *) e->contents.list[i]->hv);
-          av_push (av, sv);
-        }
-    }
-
-  if (e->args.number > 0)
-    {
-      AV *av;
-      int i;
-
-      av = newAV ();
-      sv = newRV_inc ((SV *) av);
-      hv_store (e->hv, "args", strlen ("args"), sv, 0);
-      for (i = 0; i < e->args.number; i++)
-        {
-          element_to_perl_hash (e->args.list[i]);
-          sv = newRV_inc ((SV *) e->args.list[i]->hv);
-          av_push (av, sv);
-        }
-    }
-
-  if (e->text.space > 0)
-    {
-      sv = newSVpv_utf8 (e->text.text, e->text.end);
-      hv_store (e->hv, "text", strlen ("text"), sv, 0);
-    }
-
-  if (e->extra_number > 0)
+  if (a->info_number > 0)
     {
       HV *extra;
       int i;
       int all_deleted = 1;
       extra = newHV ();
 
-      for (i = 0; i < e->extra_number; i++)
+      for (i = 0; i < a->info_number; i++)
         {
 #define STORE(sv) hv_store (extra, key, strlen (key), sv, 0)
-          char *key = e->extra[i].key;
-          ELEMENT *f = e->extra[i].value;
+          char *key = a->info[i].key;
+          ELEMENT *f = a->info[i].value;
 
-          if (e->extra[i].type == extra_deleted)
+          if (a->info[i].type == extra_deleted)
             continue;
           all_deleted = 0;
 
-          switch (e->extra[i].type)
+          switch (a->info[i].type)
             {
             case extra_element:
               /* For references to other parts of the tree, create the hash so 
@@ -567,9 +495,89 @@ element_to_perl_hash (ELEMENT *e)
 #undef STORE
 
       if (!all_deleted)
-        hv_store (e->hv, "extra", strlen ("extra"),
+        hv_store (e->hv, key, strlen (key),
                   newRV_inc((SV *)extra), 0);
     }
+}
+
+/* Set E->hv and 'hv' on E's descendants.  e->parent->hv is assumed
+   to already exist. */
+static void
+element_to_perl_hash (ELEMENT *e)
+{
+  SV *sv;
+
+  dTHX;
+
+  /* e->hv may already exist if there was an extra value elsewhere
+     referring to e. */
+  if (!e->hv)
+    {
+      e->hv = newHV ();
+    }
+
+  if (e->parent)
+    {
+      if (!e->parent->hv)
+        e->parent->hv = newHV ();
+      sv = newRV_inc ((SV *) e->parent->hv);
+      hv_store (e->hv, "parent", strlen ("parent"), sv, 0);
+    }
+
+  if (e->type)
+    {
+      sv = newSVpv (element_type_names[e->type], 0);
+      hv_store (e->hv, "type", strlen ("type"), sv, 0);
+    }
+
+  if (e->cmd)
+    {
+      sv = newSVpv (command_name(e->cmd), 0);
+      hv_store (e->hv, "cmdname", strlen ("cmdname"), sv, 0);
+
+      /* Note we could optimize the call to newSVpv here and
+         elsewhere by passing an appropriate second argument. */
+    }
+
+  if (e->contents.number > 0)
+    {
+      AV *av;
+      int i;
+
+      av = newAV ();
+      sv = newRV_inc ((SV *) av);
+      hv_store (e->hv, "contents", strlen ("contents"), sv, 0);
+      for (i = 0; i < e->contents.number; i++)
+        {
+          element_to_perl_hash (e->contents.list[i]);
+          sv = newRV_inc ((SV *) e->contents.list[i]->hv);
+          av_push (av, sv);
+        }
+    }
+
+  if (e->args.number > 0)
+    {
+      AV *av;
+      int i;
+
+      av = newAV ();
+      sv = newRV_inc ((SV *) av);
+      hv_store (e->hv, "args", strlen ("args"), sv, 0);
+      for (i = 0; i < e->args.number; i++)
+        {
+          element_to_perl_hash (e->args.list[i]);
+          sv = newRV_inc ((SV *) e->args.list[i]->hv);
+          av_push (av, sv);
+        }
+    }
+
+  if (e->text.space > 0)
+    {
+      sv = newSVpv_utf8 (e->text.text, e->text.end);
+      hv_store (e->hv, "text", strlen ("text"), sv, 0);
+    }
+
+  store_additional_info (e, e->extra_info, "extra");
 
   if (e->source_info.line_nr)
     {
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 87ca036edd..835b579822 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -1028,7 +1028,9 @@ end_line_starting_block (ELEMENT *current)
               memcpy (new, e, sizeof (ELEMENT));
               new->type = ET_bracketed_multitable_prototype;
               new->parent = 0;
-              new->extra_number = 0;
+              /* TODO the extra_info information in e is not copied over,
+                 at least leading/trailing spaces (something else?). */
+              new->extra_info = new_associated_info();
               add_to_contents_as_array (prototypes, new);
             }
           else if (e->text.end > 0)
diff --git a/tp/Texinfo/XS/parsetexi/extra.c b/tp/Texinfo/XS/parsetexi/extra.c
index ccdb7fe5c0..f9e67d3dd3 100644
--- a/tp/Texinfo/XS/parsetexi/extra.c
+++ b/tp/Texinfo/XS/parsetexi/extra.c
@@ -19,30 +19,30 @@
 #include "parser.h"
 
 static void
-add_extra_key (ELEMENT *e, char *key, ELEMENT *value,
-               enum extra_type type)
+add_associated_info_key (ASSOCIATED_INFO *a, char *key, ELEMENT *value,
+                         enum extra_type type)
 {
   int i;
-  for (i = 0; i < e->extra_number; i++)
+  for (i = 0; i < a->info_number; i++)
     {
-      if (!strcmp (e->extra[i].key, key))
+      if (!strcmp (a->info[i].key, key))
         break;
     }
-  if (i == e->extra_number)
+  if (i == a->info_number)
     {
-      if (e->extra_number == e->extra_space)
+      if (a->info_number == a->info_space)
         {
-          e->extra = realloc (e->extra,
-                              (e->extra_space += 5) * sizeof (KEY_PAIR));
-          if (!e->extra)
+          a->info = realloc (a->info,
+                              (a->info_space += 5) * sizeof (KEY_PAIR));
+          if (!a->info)
             fatal ("realloc failed");
         }
-      e->extra_number++;
+      a->info_number++;
     }
 
-  e->extra[i].key = key;
-  e->extra[i].value = value;
-  e->extra[i].type = type;
+  a->info[i].key = key;
+  a->info[i].value = value;
+  a->info[i].type = type;
 }
 
 /* Add an extra key that is a reference to another element (for example, 
@@ -50,7 +50,7 @@ add_extra_key (ELEMENT *e, char *key, ELEMENT *value,
 void
 add_extra_element (ELEMENT *e, char *key, ELEMENT *value)
 {
-  add_extra_key (e, key, value, extra_element);
+  add_associated_info_key (e->extra_info, key, value, extra_element);
 }
 
 /* Add an extra key that is a reference to another element that is
@@ -58,7 +58,7 @@ add_extra_element (ELEMENT *e, char *key, ELEMENT *value)
 void
 add_extra_element_oot (ELEMENT *e, char *key, ELEMENT *value)
 {
-  add_extra_key (e, key, value, extra_element_oot);
+  add_associated_info_key (e->extra_info, key, value, extra_element_oot);
 }
 
 /* Add an extra key that is a reference to the contents array of another
@@ -66,21 +66,21 @@ add_extra_element_oot (ELEMENT *e, char *key, ELEMENT 
*value)
 void
 add_extra_contents (ELEMENT *e, char *key, ELEMENT *value)
 {
-  add_extra_key (e, key, value, extra_contents);
+  add_associated_info_key (e->extra_info, key, value, extra_contents);
 }
 
 /* Like add_extra_contents but all of the contents are out-of-tree. */
 void
 add_extra_contents_oot (ELEMENT *e, char *key, ELEMENT *value)
 {
-  add_extra_key (e, key, value, extra_contents_oot);
+  add_associated_info_key (e->extra_info, key, value, extra_contents_oot);
 }
 
 /* An array of content arrays. */
 void
 add_extra_contents_array (ELEMENT *e, char *key, ELEMENT *value)
 {
-  add_extra_key (e, key, value, extra_contents_array);
+  add_associated_info_key (e->extra_info, key, value, extra_contents_array);
 }
 
 /* Add an extra key that is a reference to the text field of another
@@ -88,7 +88,7 @@ add_extra_contents_array (ELEMENT *e, char *key, ELEMENT 
*value)
 void
 add_extra_text (ELEMENT *e, char *key, ELEMENT *value)
 {
-  add_extra_key (e, key, value, extra_text);
+  add_associated_info_key (e->extra_info, key, value, extra_text);
 }
 
 #if 0
@@ -96,7 +96,8 @@ add_extra_text (ELEMENT *e, char *key, ELEMENT *value)
 void
 add_extra_index_entry (ELEMENT *e, char *key, INDEX_ENTRY_REF *value)
 {
-  add_extra_key (e, key, (ELEMENT *) value, extra_index_entry);
+  add_associated_info_key (e->extra_info, key, (ELEMENT *) value,
+                           extra_index_entry);
 }
 #endif
 
@@ -104,13 +105,14 @@ void
 add_extra_misc_args (ELEMENT *e, char *key, ELEMENT *value)
 {
   if (!value) return;
-  add_extra_key (e, key, value, extra_misc_args);
+  add_associated_info_key (e->extra_info, key, value, extra_misc_args);
 }
 
 void
 add_extra_node_spec (ELEMENT *e, char *key, NODE_SPEC_EXTRA *value)
 {
-  add_extra_key (e, key, (ELEMENT *) value, extra_node_spec);
+  add_associated_info_key (e->extra_info, key, (ELEMENT *) value,
+                           extra_node_spec);
 }
 
 /* Used for 'node_manuals' array for the arguments given on a
@@ -118,47 +120,52 @@ add_extra_node_spec (ELEMENT *e, char *key, 
NODE_SPEC_EXTRA *value)
 void
 add_extra_node_spec_array (ELEMENT *e, char *key, NODE_SPEC_EXTRA **value)
 {
-  add_extra_key (e, key, (ELEMENT *) value, extra_node_spec_array);
+  add_associated_info_key (e->extra_info, key, (ELEMENT *) value,
+                           extra_node_spec_array);
 }
 
 void
 add_extra_def_info (ELEMENT *e, char *key, DEF_INFO *value)
 {
-  add_extra_key (e, key, (ELEMENT *) value, extra_def_info);
+  add_associated_info_key (e->extra_info, key, (ELEMENT *) value,
+                           extra_def_info);
 }
 
 void
 add_extra_float_type (ELEMENT *e, char *key, EXTRA_FLOAT_TYPE *value)
 {
-  add_extra_key (e, key, (ELEMENT *) value, extra_float_type);
+  add_associated_info_key (e->extra_info, key, (ELEMENT *) value,
+                           extra_float_type);
 }
 
 void
 add_extra_string (ELEMENT *e, char *key, char *value)
 {
-  add_extra_key (e, key, (ELEMENT *) value, extra_string);
+  add_associated_info_key (e->extra_info, key, (ELEMENT *) value, 
extra_string);
 }
 
 void
 add_extra_string_dup (ELEMENT *e, char *key, char *value)
 {
-  add_extra_key (e, key, (ELEMENT *) strdup (value), extra_string);
+  add_associated_info_key (e->extra_info, key, (ELEMENT *) strdup (value),
+                           extra_string);
 }
 
 void
 add_extra_integer (ELEMENT *e, char *key, long value)
 {
-  add_extra_key (e, key, (ELEMENT *) value, extra_integer);
+  add_associated_info_key (e->extra_info, key, (ELEMENT *) value, 
extra_integer);
 }
 
 KEY_PAIR *
 lookup_extra (ELEMENT *e, char *key)
 {
   int i;
-  for (i = 0; i < e->extra_number; i++)
+  ASSOCIATED_INFO *a = e->extra_info;
+  for (i = 0; i < a->info_number; i++)
     {
-      if (!strcmp (e->extra[i].key, key))
-        return &e->extra[i];
+      if (!strcmp (a->info[i].key, key))
+        return &a->info[i];
     }
   return 0;
 }
diff --git a/tp/Texinfo/XS/parsetexi/tree.c b/tp/Texinfo/XS/parsetexi/tree.c
index f1b64742d9..1357c72e99 100644
--- a/tp/Texinfo/XS/parsetexi/tree.c
+++ b/tp/Texinfo/XS/parsetexi/tree.c
@@ -22,6 +22,17 @@
 
 //int element_counter;
 
+ASSOCIATED_INFO *
+new_associated_info (void)
+{
+  ASSOCIATED_INFO *info = malloc (sizeof (ASSOCIATED_INFO));
+
+  info->info_number = 0;
+  info->info_space = 0;
+  info->info = 0;
+  return info;
+}
+
 ELEMENT *
 new_element (enum element_type type)
 {
@@ -41,35 +52,31 @@ new_element (enum element_type type)
   e->contents.space = 0;
   e->contents.number = 0;
   e->parent = 0;
-  e->extra = 0;
+
+  e->extra_info = new_associated_info();
 
   return e;
 }
 
 void
-destroy_element (ELEMENT *e)
+destroy_associated_info (ASSOCIATED_INFO *a)
 {
   int i;
-  free (e->text.text);
-
-  /* Note the pointers in these lists are not themselves freed. */
-  free (e->contents.list);
-  free (e->args.list);
 
-  for (i = 0; i < e->extra_number; i++)
+  for (i = 0; i < a->info_number; i++)
     {
-      switch (e->extra[i].type)
+      switch (a->info[i].type)
         {
         case extra_string:
         case extra_index_entry:
-          free (e->extra[i].value);
+          free (a->info[i].value);
           break;
         case extra_element_oot:
-          destroy_element_and_children (e->extra[i].value);
+          destroy_element_and_children (a->info[i].value);
           break;
         case extra_contents:
-          if (e->extra[i].value)
-            destroy_element ((ELEMENT *) e->extra[i].value);
+          if (a->info[i].value)
+            destroy_element ((ELEMENT *) a->info[i].value);
           break;
         case extra_contents_oot:
           {
@@ -77,7 +84,7 @@ destroy_element (ELEMENT *e)
             /* Free each element in the array, but not any children
                of each element. */
             int j;
-            ELEMENT *array = e->extra[i].value;
+            ELEMENT *array = a->info[i].value;
             for (j = 0 ; j < array->contents.number; j++)
               {
                 if (array->contents.list[j])
@@ -92,7 +99,7 @@ destroy_element (ELEMENT *e)
         case extra_contents_array:
           {
             int j;
-            ELEMENT *array = e->extra[i].value;
+            ELEMENT *array = a->info[i].value;
             for (j = 0 ; j < array->contents.number; j++)
               {
                 if (array->contents.list[j])
@@ -103,7 +110,7 @@ destroy_element (ELEMENT *e)
           }
         case extra_node_spec:
             {
-              NODE_SPEC_EXTRA *nse = (NODE_SPEC_EXTRA *) e->extra[i].value;
+              NODE_SPEC_EXTRA *nse = (NODE_SPEC_EXTRA *) a->info[i].value;
 
               if (nse->manual_content)
                 destroy_element (nse->manual_content);
@@ -114,7 +121,7 @@ destroy_element (ELEMENT *e)
             }
         case extra_node_spec_array:
             {
-              NODE_SPEC_EXTRA **array = (NODE_SPEC_EXTRA **) e->extra[i].value;
+              NODE_SPEC_EXTRA **array = (NODE_SPEC_EXTRA **) a->info[i].value;
               NODE_SPEC_EXTRA **nse;
 
               for (nse = array; (*nse); nse++)
@@ -130,24 +137,39 @@ destroy_element (ELEMENT *e)
             }
         case extra_float_type:
           {
-            EXTRA_FLOAT_TYPE *eft = (EXTRA_FLOAT_TYPE *) e->extra[i].value;
+            EXTRA_FLOAT_TYPE *eft = (EXTRA_FLOAT_TYPE *) a->info[i].value;
             free (eft->normalized);
 
             free (eft);
             break;
           }
         case extra_misc_args:
-          destroy_element_and_children (e->extra[i].value);
+          destroy_element_and_children (a->info[i].value);
           break;
         case extra_def_info:
-          free (e->extra[i].value);
+          free (a->info[i].value);
           break;
 
         default:
           break;
         }
     }
-  free (e->extra);
+  free (a->info);
+
+  free (a);
+}
+
+void
+destroy_element (ELEMENT *e)
+{
+  int i;
+  free (e->text.text);
+
+  /* Note the pointers in these lists are not themselves freed. */
+  free (e->contents.list);
+  free (e->args.list);
+
+  destroy_associated_info (e->extra_info);
 
   free (e);
 }
diff --git a/tp/Texinfo/XS/parsetexi/tree.h b/tp/Texinfo/XS/parsetexi/tree.h
index acb224abec..4b5e4e68f1 100644
--- a/tp/Texinfo/XS/parsetexi/tree.h
+++ b/tp/Texinfo/XS/parsetexi/tree.h
@@ -4,6 +4,7 @@
 
 #include "tree_types.h"
 
+ASSOCIATED_INFO *new_associated_info (void);
 ELEMENT *new_element (enum element_type type);
 void add_to_element_contents (ELEMENT *parent, ELEMENT *e);
 void add_to_contents_as_array (ELEMENT *parent, ELEMENT *e);
diff --git a/tp/Texinfo/XS/parsetexi/tree_types.h 
b/tp/Texinfo/XS/parsetexi/tree_types.h
index 66e84cf956..cba51f3fde 100644
--- a/tp/Texinfo/XS/parsetexi/tree_types.h
+++ b/tp/Texinfo/XS/parsetexi/tree_types.h
@@ -58,6 +58,12 @@ typedef struct SOURCE_INFO {
     char *macro;
 } SOURCE_INFO;
 
+typedef struct ASSOCIATED_INFO {
+    KEY_PAIR *info;
+    size_t info_number;
+    size_t info_space;
+} ASSOCIATED_INFO;
+
 typedef struct ELEMENT {
     enum command_id cmd;
     TEXT text;
@@ -67,9 +73,7 @@ typedef struct ELEMENT {
     struct ELEMENT *parent;
     SOURCE_INFO source_info;
 
-    KEY_PAIR *extra;
-    size_t extra_number;
-    size_t extra_space;
+    ASSOCIATED_INFO *extra_info;
 
     /********* Used when building Perl tree only ********************/
     void *hv;



reply via email to

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