texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Sun, 19 May 2024 16:23:17 -0400 (EDT)

branch: master
commit 9bc57f7266d5b59ac9ea6c67b6eb0d11432e9fee
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun May 19 21:53:25 2024 +0200

    * tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf),
    tp/Texinfo/XS/parsetexi/parser.c (parse_texi): call
    init_index_commands in reset_parser_except_conf and not in parse_texi,
    now that reset_parser_except_conf only called right before parse_texi
    and not in reset_parser anymore.
---
 ChangeLog                        | 8 ++++++++
 tp/Texinfo/XS/parsetexi/api.c    | 9 ++++++++-
 tp/Texinfo/XS/parsetexi/parser.c | 6 ------
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b0c6897044..2faad888ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-05-19  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf),
+       tp/Texinfo/XS/parsetexi/parser.c (parse_texi): call
+       init_index_commands in reset_parser_except_conf and not in parse_texi,
+       now that reset_parser_except_conf only called right before parse_texi
+       and not in reset_parser anymore.
+
 2024-05-19  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf, parse_file)
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 3a869bf5c7..39e972599a 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -43,15 +43,20 @@
 #include "document.h"
 /* for reset_conf */
 #include "conf.h"
+/* for init_index_commands */
+#include "indices.h"
 #include "api.h"
 
 void
 reset_parser_except_conf (void)
 {
+  parsed_document = new_document ();
+
   wipe_parser_global_variables ();
 
   wipe_user_commands ();
   wipe_macros ();
+
   init_values ();
 
   reset_context_stack ();
@@ -71,7 +76,9 @@ reset_parser_except_conf (void)
 
   current_node = current_section = current_part = 0;
 
-  parsed_document = new_document ();
+  if (!conf.no_index)
+    init_index_commands ();
+
   set_input_encoding ("utf-8");
 }
 
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 3af7f51d9b..3a8cec3bd2 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -2509,12 +2509,6 @@ parse_texi (ELEMENT *root_elt, ELEMENT *current_elt)
   int status;
   DOCUMENT *document = parsed_document;
 
-  /* done here and not in reset_parser_except_conf as usually done
-     as restricted is set after reset_parser_except_conf and before
-     calling parsing functions */
-  if (!conf.no_index)
-    init_index_commands ();
-
   /* Read input file line-by-line. */
   while (1)
     {



reply via email to

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