[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,
- Prev by Date:
[no subject]
- Next by Date:
branch master updated: * tp/Texinfo/XS/main/tree_types.h (CONTAINER), tp/Texinfo/XS/main/element_types.awk, tp/Texinfo/XS/main/build_perl_info.c (element_to_perl_hash), tp/Texinfo/XS/main/convert_to_texinfo.c (expand_cmd_args_to_texi), tp/Texinfo/XS/parsetexi/parser.c (move_last_space_to_element): remove eit_brace_content_spaces_before_argument from enum elt_info_type, use eit_spaces_before_argument instead. Do not overload enum elt_info_type indices, instead allow an unused slot for some elements in elt_info.
- Previous by thread:
[no subject]
- Next by thread:
branch master updated: * tp/Texinfo/XS/main/tree_types.h (CONTAINER), tp/Texinfo/XS/main/element_types.awk, tp/Texinfo/XS/main/build_perl_info.c (element_to_perl_hash), tp/Texinfo/XS/main/convert_to_texinfo.c (expand_cmd_args_to_texi), tp/Texinfo/XS/parsetexi/parser.c (move_last_space_to_element): remove eit_brace_content_spaces_before_argument from enum elt_info_type, use eit_spaces_before_argument instead. Do not overload enum elt_info_type indices, instead allow an unused slot for some elements in elt_info.
- Index(es):