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/def.c (parse_def), tp/T


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/def.c (parse_def), tp/Texinfo/XS/parsetexi/end_line.c (end_line_def_line): use directly the definition line arguments to determine the class/category/name for the index entry. Remove the returned information from parse_def.
Date: Sat, 28 Sep 2024 17:49:03 -0400

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 f23c40880c * tp/Texinfo/XS/parsetexi/def.c (parse_def), 
tp/Texinfo/XS/parsetexi/end_line.c (end_line_def_line): use directly the 
definition line arguments to determine the class/category/name for the index 
entry.  Remove the returned information from parse_def.
f23c40880c is described below

commit f23c40880c2ad4a4f3817400664e456b0a0baaf9
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jun 2 21:32:07 2024 +0200

    * tp/Texinfo/XS/parsetexi/def.c (parse_def),
    tp/Texinfo/XS/parsetexi/end_line.c (end_line_def_line): use directly
    the definition line arguments to determine the class/category/name for
    the index entry.  Remove the returned information from parse_def.
    
    * tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): remove an
    impossible condition, as the linemacro call bracketed type is a
    different type now.
    
    * tp/Texinfo/XS/parsetexi/def.c (split_def_args): remove a redundant
    condition.
---
 ChangeLog                           | 14 ++++++++++++++
 tp/TODO                             | 21 ++++++++++++++-------
 tp/Texinfo/XS/parsetexi/close.c     |  5 +++--
 tp/Texinfo/XS/parsetexi/def.c       | 16 +---------------
 tp/Texinfo/XS/parsetexi/def.h       |  2 +-
 tp/Texinfo/XS/parsetexi/end_line.c  | 26 +++++++++++++-------------
 tp/Texinfo/XS/parsetexi/separator.c |  3 +--
 7 files changed, 47 insertions(+), 40 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ccab4c8842..507fbb55f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,20 @@
 
        Update test result
 
+2024-06-01  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/def.c (parse_def),
+       tp/Texinfo/XS/parsetexi/end_line.c (end_line_def_line): use directly
+       the definition line arguments to determine the class/category/name for
+       the index entry.  Remove the returned information from parse_def.
+
+       * tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): remove an
+       impossible condition, as the linemacro call bracketed type is a
+       different type now.
+
+       * tp/Texinfo/XS/parsetexi/def.c (split_def_args): remove a redundant
+       condition.
+
 2024-06-01  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/element_types.txt: remove unused
diff --git a/tp/TODO b/tp/TODO
index 844bb1ca70..471a361939 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -139,6 +139,7 @@ where:
   index_line
   heading_spec
   two_col_table: on @table/@vtable line
+  multitable
  lineraw
 
 element:
@@ -151,19 +152,25 @@ text-cmd_brace-plain_text key % brace ltspaces_in_arg
 index_line-cmd_brace-plain_text sortas % brace ltspaces_not_in_arg
 heading_spec-cmd_nobrace | % nobrace
 preamble-cmd_brace-plain_text hyphenation % brace ltspaces_not_in_arg
-content+line-cmd_line-plain_text end
-content+line-cmd_line-lineraw set clear
-content-cmd_line-lineraw unmacro clickstyle vskip
-comments-cmd_line-lineraw c comment
-line-cmd_line-plain_text columnfractions % line (on @multitable line, only 
floats)
+content+line-cmd_line-plain_text end % line
+content+line-cmd_line-lineraw set clear % lineraw
+content-cmd_line-lineraw unmacro clickstyle vskip % lineraw
+comments-cmd_line-lineraw c comment % lineraw 
+multitable-cmd_line-plain_text columnfractions % line (on @multitable line, 
only floats)
 line-cmd_line-text subentry % line
 root-cmd_line bye raisesections lowersections contents shortcontents % line 
noarg
-content-cmd_line insertcopying
+content-cmd_line insertcopying % line noarg
 content+line+text-cmd_nobrace refill % nobrace
 content-cmd_nobrace noindent indent % nobrace leads to a warning if in 
paragraph
 block-cmd_nobrace-content headitem item in multitable % nobrace
 content-container-text paragraph preformatted
-two_col_table-cmd_nobrace+cmd_brace except BRACE_noarg BRACE_accent
+two_col_table-cmd_nobrace+cmd_brace command_as_argument, containing
+                                    brace commands except BRACE_noarg 
BRACE_accent
+                                    and not_in_basic_inline_commands
+content+text-cmd_line-line(index_line) findex... index_entry_command % line
+def_line-line_container-text+bracketed_arg def_line_arg (argument has no space 
at top level)
+multitable-bracketed-text bracketed_arg for multitable prototypes % bracketed 
ltspaces_not_in_arg
+def_line_container-bracketed-text % bracketed ltspaces_not_in_arg
 
 Groups:
 $plain_text = text text_symbol text_plain_text_container comments
diff --git a/tp/Texinfo/XS/parsetexi/close.c b/tp/Texinfo/XS/parsetexi/close.c
index 5db1480750..bed5134459 100644
--- a/tp/Texinfo/XS/parsetexi/close.c
+++ b/tp/Texinfo/XS/parsetexi/close.c
@@ -133,8 +133,9 @@ is_container_empty (ELEMENT *current)
         return 1;
     }
   else if (current->c->contents.number == 0
-          && current->c->args.number == 0
-          && current->info_info.info_number == 0)
+           && current->c->args.number == 0
+           /* FIXME this is certainly wrong */
+           && current->info_info.info_number == 0)
     return 1;
 
   return 0;
diff --git a/tp/Texinfo/XS/parsetexi/def.c b/tp/Texinfo/XS/parsetexi/def.c
index ba5faf3200..ff66648629 100644
--- a/tp/Texinfo/XS/parsetexi/def.c
+++ b/tp/Texinfo/XS/parsetexi/def.c
@@ -303,14 +303,6 @@ split_def_args (ELEMENT *current, int starting_idx)
           continue;
         }
 
-      if (e->type == ET_spaces)
-        {
-          int status;
-          int inserted = lookup_info_integer (e, "inserted", &status);
-          if (inserted > 0)
-            continue;
-        }
-
       if (e->type != ET_normal_text)
         continue;
 
@@ -357,7 +349,7 @@ split_def_args (ELEMENT *current, int starting_idx)
     }
 }
 
-ELEMENT **
+void
 parse_def (enum command_id command, ELEMENT *current)
 {
   int contents_idx = 0;
@@ -365,7 +357,6 @@ parse_def (enum command_id command, ELEMENT *current)
   int i, i_def;
   int arg_types_nr;
   ELEMENT *e, *e1;
-  ELEMENT **result;
   enum command_id *arguments_types_list;
   int inserted_category = 0;
 
@@ -433,7 +424,6 @@ parse_def (enum command_id command, ELEMENT *current)
         break;
       arg_types_nr++;
     }
-  result = malloc ((arg_types_nr+1) * sizeof (ELEMENT *));
 
   for (i = 0; i < arg_types_nr; i++)
     {
@@ -447,14 +437,11 @@ parse_def (enum command_id command, ELEMENT *current)
           new_def_type->parent = e->parent;
           current->c->contents.list[contents_idx - 1] = new_def_type;
           add_to_element_contents (new_def_type, e);
-          result[i] = new_def_type;
         }
       else
         break;
     }
 
-  result[i] = 0;
-
   if (inserted_category)
     {
       add_info_integer (current->c->contents.list[0], "inserted", 1);
@@ -505,5 +492,4 @@ parse_def (enum command_id command, ELEMENT *current)
       add_to_element_contents (new_def_type, e);
       current->c->contents.list[i] = new_def_type;
     }
-  return result;
 }
diff --git a/tp/Texinfo/XS/parsetexi/def.h b/tp/Texinfo/XS/parsetexi/def.h
index c11e49fd54..e2cc7d550c 100644
--- a/tp/Texinfo/XS/parsetexi/def.h
+++ b/tp/Texinfo/XS/parsetexi/def.h
@@ -6,5 +6,5 @@
 #include "tree_types.h"
 
 void gather_def_item (ELEMENT *current, enum command_id next_command);
-ELEMENT **parse_def (enum command_id command, ELEMENT *current);
+void parse_def (enum command_id command, ELEMENT *current);
 #endif
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 9a5b41ce85..c8d5ffe5ad 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -678,8 +678,8 @@ parse_line_command_args (ELEMENT *line_command)
 ELEMENT *
 end_line_def_line (ELEMENT *current)
 {
+  ELEMENT *def_line_container = current;
   enum command_id def_command;
-  ELEMENT **def_info = 0;
   char *def_cmdname;
   ELEMENT *index_entry = 0; /* Index entry text. */
   ELEMENT *def_info_name = 0;
@@ -698,24 +698,24 @@ end_line_def_line (ELEMENT *current)
                command_name(def_command));
   debug_parser_print_element (current, 1); debug ("");
 
-  def_info = parse_def (def_command, current);
+  parse_def (def_command, current);
 
   /* def_line */
   current = current->parent;
 
-  /* Record the index entry if def_info is not empty. */
-
-  while (def_info[i] != 0)
+  /* Record the index entry if def_line_container is not empty. */
+  for (i = 0; i < def_line_container->c->contents.number; i++)
     {
-      if (def_info[i]->type == ET_def_name)
-        def_info_name = def_info[i];
-      else if (def_info[i]->type == ET_def_class)
-        def_info_class = def_info[i];
-      else if (def_info[i]->type == ET_def_category)
-        def_info_category = def_info[i];
-      i++;
+      ELEMENT *def_e = def_line_container->c->contents.list[i];
+      if (def_e->type == ET_def_name)
+        def_info_name = def_e;
+      else if (def_e->type == ET_def_class)
+        def_info_class = def_e;
+      else if (def_e->type == ET_def_category)
+        def_info_category = def_e;
+      else if (def_e->type == ET_def_arg || def_e->type == ET_def_typearg)
+        break;
     }
-  free (def_info);
 
   if (def_info_category)
     {
diff --git a/tp/Texinfo/XS/parsetexi/separator.c 
b/tp/Texinfo/XS/parsetexi/separator.c
index 10e219a189..47fb8ac535 100644
--- a/tp/Texinfo/XS/parsetexi/separator.c
+++ b/tp/Texinfo/XS/parsetexi/separator.c
@@ -200,8 +200,7 @@ handle_open_brace (ELEMENT *current, const char 
**line_inout)
       debug_parser_print_element (current, 0); debug ("");
     }
   else if (current->parent && (current->parent->cmd == CM_multitable
-                               || current->parent->type == ET_def_line
-                               || current->parent->type == ET_linemacro_call))
+                               || current->parent->type == ET_def_line))
     {
       ELEMENT *b, *e;
       abort_empty_line (&current);



reply via email to

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