texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Gavin D. Smith
Date: Tue, 22 Oct 2024 18:17:27 -0400 (EDT)

branch: master
commit 66d17fe6ceeeff84d9cb2135d2689d670f3f1c43
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Mon Oct 21 21:45:13 2024 +0100

    * tp/Texinfo/XS/main/build_perl_info.c (element_to_perl_hash):
    Place code processing string_info together and code processing
    elt_info together.
---
 ChangeLog                            |  6 +++
 tp/Texinfo/XS/main/build_perl_info.c | 92 +++++++++++++++++++-----------------
 2 files changed, 54 insertions(+), 44 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c401dbb611..441a80cb0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-10-21  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/XS/main/build_perl_info.c (element_to_perl_hash):
+       Place code processing string_info together and code processing
+       elt_info together.
+
 2024-10-21  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/XS/main/build_perl_info.c (element_to_perl_hash):
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index fa7e0fd077..cfc3290aaf 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -799,6 +799,54 @@ element_to_perl_hash (ELEMENT *e, int avoid_recursion)
 
 #undef store_flag
 
+  /* process string_info array */
+
+  if (e->e.c->cmd)
+    {
+      if (e->e.c->string_info[sit_alias_of])
+        store_info_string (e, e->e.c->string_info[sit_alias_of],
+                          "alias_of", &info_hv);
+
+      /* string_info array */
+      if (e->type == ET_index_entry_command)
+        {
+          if (e->e.c->string_info[sit_command_name])
+            store_info_string (e,
+                  e->e.c->string_info[sit_command_name],
+                  "command_name", &info_hv);
+        }
+      if (e->type == ET_lineraw_command)
+        {
+          if (e->e.c->string_info[sit_arg_line])
+             store_info_string (e, e->e.c->string_info[sit_arg_line],
+                      "arg_line", &info_hv);
+        }
+      if (e->type == ET_definfoenclose_command)
+        {
+          if (e->e.c->string_info[sit_command_name])
+            store_info_string (e,
+                  e->e.c->string_info[sit_command_name],
+                  "command_name", &info_hv);
+        }
+      if (e->e.c->cmd == CM_verb && e->e.c->args.number > 0)
+        {
+          store_info_string (e, e->e.c->string_info[sit_delimiter],
+                             "delimiter", &info_hv);
+        }
+    }
+  else if (type_data[e->type].flags & TF_macro_call)
+    {
+      if (e->e.c->string_info[sit_alias_of])
+        store_info_string (e, e->e.c->string_info[sit_alias_of],
+                      "alias_of", &info_hv);
+
+      if (e->e.c->string_info[sit_command_name])
+        store_info_string (e, e->e.c->string_info[sit_command_name],
+                      "command_name", &info_hv);
+    }
+
+  /* process elt_info array */
+
   if (e->e.c->cmd)
     {
       enum command_id data_cmd;
@@ -809,10 +857,6 @@ element_to_perl_hash (ELEMENT *e, int avoid_recursion)
       sv = newSVpv (element_command_name (e), 0);
       hv_store (e->hv, "cmdname", strlen ("cmdname"), sv, HSH_cmdname);
 
-      if (e->e.c->string_info[sit_alias_of])
-        store_info_string (e, e->e.c->string_info[sit_alias_of],
-                          "alias_of", &info_hv);
-
       data_cmd = element_builtin_data_cmd (e);
       flags = builtin_command_data[data_cmd].flags;
 
@@ -823,19 +867,6 @@ element_to_perl_hash (ELEMENT *e, int avoid_recursion)
               store_info_element (e, e->elt_info[eit_spaces_before_argument],
                               "spaces_before_argument",
                               avoid_recursion, &info_hv);
-              if (e->type == ET_index_entry_command)
-                {
-                  if (e->e.c->string_info[sit_command_name])
-                    store_info_string (e,
-                          e->e.c->string_info[sit_command_name],
-                          "command_name", &info_hv);
-                }
-            }
-          else
-            {
-              if (e->e.c->string_info[sit_arg_line])
-                 store_info_string (e, e->e.c->string_info[sit_arg_line],
-                          "arg_line", &info_hv);
             }
         }
       else if (flags & CF_block)
@@ -845,11 +876,6 @@ element_to_perl_hash (ELEMENT *e, int avoid_recursion)
               store_info_element (e, e->elt_info[eit_spaces_before_argument],
                                   "spaces_before_argument",
                                   avoid_recursion, &info_hv);
-            } else {
-              /* @*macro */
-              if (e->e.c->string_info[sit_arg_line])
-                 store_info_string (e, e->e.c->string_info[sit_arg_line],
-                          "arg_line", &info_hv);
             }
         }
       else if (e->type != ET_nobrace_command
@@ -865,21 +891,6 @@ element_to_perl_hash (ELEMENT *e, int avoid_recursion)
                   "spaces_before_argument",
                   avoid_recursion, &info_hv);
             }
-          else
-            {
-              if (e->type == ET_definfoenclose_command)
-                {
-                  if (e->e.c->string_info[sit_command_name])
-                    store_info_string (e,
-                          e->e.c->string_info[sit_command_name],
-                          "command_name", &info_hv);
-                }
-              if (e->e.c->cmd == CM_verb && e->e.c->args.number > 0)
-                {
-                  store_info_string (e, e->e.c->string_info[sit_delimiter],
-                                     "delimiter", &info_hv);
-                }
-            }
         }
     }
   else /* types / containers */
@@ -905,13 +916,6 @@ element_to_perl_hash (ELEMENT *e, int avoid_recursion)
         }
       else if (type_data[e->type].flags & TF_macro_call)
         {
-          if (e->e.c->string_info[sit_alias_of])
-            store_info_string (e, e->e.c->string_info[sit_alias_of],
-                          "alias_of", &info_hv);
-
-          if (e->e.c->string_info[sit_command_name])
-            store_info_string (e, e->e.c->string_info[sit_command_name],
-                          "command_name", &info_hv);
           if (type_data[e->type].flags & TF_braces)
             {
               store_info_element (e,



reply via email to

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