[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 911a8362f87389282ff1ced9047150f03e110485
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Feb 25 19:26:24 2024 +0000
Reset parsetexi counters
* tp/Texinfo/XS/parsetexi/counter.c (counter_reset): New function.
* tp/Texinfo/XS/parsetexi/macro.c: Call it on 'count_toplevel_braces'.
---
ChangeLog | 7 +++++++
tp/Texinfo/XS/parsetexi/counter.c | 6 ++++++
tp/Texinfo/XS/parsetexi/counter.h | 1 +
tp/Texinfo/XS/parsetexi/macro.c | 1 +
4 files changed, 15 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 4f679ce9d4..37d430fa60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-02-25 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Reset parsetexi counters
+
+ * tp/Texinfo/XS/parsetexi/counter.c (counter_reset): New function.
+ * tp/Texinfo/XS/parsetexi/macro.c: Call it on 'count_toplevel_braces'.
+
2024-02-25 Gavin Smith <gavinsmith0123@gmail.com>
* tp/Texinfo/Document.pm
diff --git a/tp/Texinfo/XS/parsetexi/counter.c
b/tp/Texinfo/XS/parsetexi/counter.c
index 84cdcd2ebc..d2b35fcbf4 100644
--- a/tp/Texinfo/XS/parsetexi/counter.c
+++ b/tp/Texinfo/XS/parsetexi/counter.c
@@ -72,3 +72,9 @@ counter_value (COUNTER *c, ELEMENT *elt)
else
return -1;
}
+
+void
+counter_reset (COUNTER *c)
+{
+ c->nvalues = 0;
+}
diff --git a/tp/Texinfo/XS/parsetexi/counter.h
b/tp/Texinfo/XS/parsetexi/counter.h
index d2b29291d3..92041aae24 100644
--- a/tp/Texinfo/XS/parsetexi/counter.h
+++ b/tp/Texinfo/XS/parsetexi/counter.h
@@ -33,6 +33,7 @@ void counter_pop (COUNTER *c);
void counter_inc (COUNTER *c);
void counter_dec (COUNTER *c);
int counter_value (COUNTER *c, ELEMENT *e);
+void counter_reset (COUNTER *c);
/* A large positive number used to represent an unlimited number of remaining
arguments. */
diff --git a/tp/Texinfo/XS/parsetexi/macro.c b/tp/Texinfo/XS/parsetexi/macro.c
index 3bd4eb8b14..16ace6a9f2 100644
--- a/tp/Texinfo/XS/parsetexi/macro.c
+++ b/tp/Texinfo/XS/parsetexi/macro.c
@@ -472,6 +472,7 @@ expand_linemacro_arguments (ELEMENT *macro, char
**line_inout,
int i;
ELEMENT *argument = new_element (ET_NONE);
ELEMENT *argument_content = new_element (ET_NONE);
+ counter_reset (&count_toplevel_braces);
counter_push (&count_toplevel_braces, argument_content, 0);
add_to_element_args (current, argument);