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: Sun, 25 Feb 2024 14:42:26 -0500 (EST)

branch: master
commit 23da32ceb93ef7495ccaae68f276ae8fcb6ac4a8
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Feb 25 19:38:54 2024 +0000

    Reset parsetexi counters
    
    * tp/Texinfo/XS/parsetexi/parser.c (reset_parser_counters): New.
    * tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf): Call it.
    
    There were intermittent failures in the t/03coverage_braces.t
    definfoenclose_texinfo_commands test due to one of the counters
    not being reset.
---
 ChangeLog                        | 11 +++++++++++
 tp/Texinfo/XS/parsetexi/api.c    |  1 +
 tp/Texinfo/XS/parsetexi/parser.c |  8 ++++++++
 tp/Texinfo/XS/parsetexi/parser.h |  1 +
 4 files changed, 21 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 37d430fa60..ea3a5d270b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-02-25  Gavin Smith <gavinsmith0123@gmail.com>
+
+       Reset parsetexi counters
+
+       * tp/Texinfo/XS/parsetexi/parser.c (reset_parser_counters): New.
+       * tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf): Call it.
+
+       There were intermittent failures in the t/03coverage_braces.t
+       definfoenclose_texinfo_commands test due to one of the counters
+       not being reset.
+
 2024-02-25  Gavin Smith <gavinsmith0123@gmail.com>
 
        Reset parsetexi counters
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 8f01f3c17c..ff693023bb 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -82,6 +82,7 @@ reset_parser_except_conf (void)
   reset_command_stack (&nesting_context.basic_inline_stack_block);
   reset_command_stack (&nesting_context.regions_stack);
   memset (&nesting_context, 0, sizeof (nesting_context));
+  reset_parser_counters ();
   /* it is not totally obvious that is it better to reset the
      list to avoid memory leaks rather than reuse the iconv
      opened handlers */
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 5d22df810c..731cfc56a4 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -302,6 +302,14 @@ COUNTER count_remaining_args;
 COUNTER count_items;
 COUNTER count_cells;
 
+void
+reset_parser_counters (void)
+{
+  counter_reset (&count_remaining_args);
+  counter_reset (&count_items);
+  counter_reset (&count_cells);
+}
+
 
 /* Information that is not local to where it is set in the Texinfo input,
    for example document language and encoding. */
diff --git a/tp/Texinfo/XS/parsetexi/parser.h b/tp/Texinfo/XS/parsetexi/parser.h
index d236bf4895..e9c146dfeb 100644
--- a/tp/Texinfo/XS/parsetexi/parser.h
+++ b/tp/Texinfo/XS/parsetexi/parser.h
@@ -142,6 +142,7 @@ int register_global_command (ELEMENT *current);
 void wipe_parser_global_info (void);
 
 extern COUNTER count_remaining_args, count_items, count_cells;
+void reset_parser_counters (void);
 
 /* In multitable.c */
 ELEMENT *item_multitable_parent (ELEMENT *current);



reply via email to

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