[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/main/command_stack.c, tp/Texinfo/
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/main/command_stack.c, tp/Texinfo/XS/parsetexi/counter.c (print_counter_top): debugging code. |
Date: |
Sun, 29 Sep 2024 09:22:32 -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 2f6205855a * tp/Texinfo/XS/main/command_stack.c,
tp/Texinfo/XS/parsetexi/counter.c (print_counter_top): debugging code.
2f6205855a is described below
commit 2f6205855a043469000a029984c09f58aeb2c200
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Jul 1 10:56:48 2024 +0200
* tp/Texinfo/XS/main/command_stack.c,
tp/Texinfo/XS/parsetexi/counter.c (print_counter_top): debugging code.
---
ChangeLog | 5 +++++
tp/Texinfo/XS/main/command_stack.c | 11 +++++++++++
tp/Texinfo/XS/parsetexi/counter.c | 18 ++++++++++++++++++
tp/Texinfo/XS/parsetexi/counter.h | 2 ++
4 files changed, 36 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 41677fcc80..02ac613432 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-07-01 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/command_stack.c,
+ tp/Texinfo/XS/parsetexi/counter.c (print_counter_top): debugging code.
+
2024-06-30 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/parsetexi/separator.c (handle_close_brace): fix @U
diff --git a/tp/Texinfo/XS/main/command_stack.c
b/tp/Texinfo/XS/main/command_stack.c
index 79af1e086d..0263f052a8 100644
--- a/tp/Texinfo/XS/main/command_stack.c
+++ b/tp/Texinfo/XS/main/command_stack.c
@@ -19,6 +19,9 @@
#include "tree_types.h"
#include "command_ids.h"
+/*
+#include "commands.h"
+ */
#include "utils.h"
#include "command_stack.h"
@@ -43,6 +46,10 @@ push_command (COMMAND_STACK *stack, enum command_id cmd)
(stack->space += 5) * sizeof (enum command_id));
}
+ /*
+ fprintf (stderr, "---STPUSH %p (%ld) %d %s\n", stack, stack->top,
+ cmd, command_name(cmd));
+ */
stack->stack[stack->top] = cmd;
stack->top++;
}
@@ -53,6 +60,10 @@ pop_command (COMMAND_STACK *stack)
if (stack->top == 0)
fatal ("command stack empty");
+ /*
+ fprintf (stderr, "---STPOP %p (%ld) %d %s\n", stack, stack->top,
+ stack->stack[stack->top-1], command_name(stack->stack[stack->top-1]));
+ */
return stack->stack[--stack->top];
}
diff --git a/tp/Texinfo/XS/parsetexi/counter.c
b/tp/Texinfo/XS/parsetexi/counter.c
index b041859fd6..49f543c8a8 100644
--- a/tp/Texinfo/XS/parsetexi/counter.c
+++ b/tp/Texinfo/XS/parsetexi/counter.c
@@ -149,3 +149,21 @@ counter_reset (COUNTER *c, const char* not_empty_message)
c->nvalues = 0;
}
+
+/* for debugging */
+void
+print_counter_top (COUNTER *c)
+{
+ if (c->nvalues > 0)
+ {
+ ELEMENT *top_elt = c->elts[c->nvalues - 1];
+ char *element_string = print_element_debug (top_elt, 0);
+ int value = counter_value (c, top_elt);
+ fprintf (stderr, "COUNTER %p: %s: %d\n", c, element_string, value);
+ free (element_string);
+ }
+ else
+ {
+ fprintf (stderr, "COUNTER %p: no values\n", c);
+ }
+}
diff --git a/tp/Texinfo/XS/parsetexi/counter.h
b/tp/Texinfo/XS/parsetexi/counter.h
index 55a213b43f..82a81e2fa9 100644
--- a/tp/Texinfo/XS/parsetexi/counter.h
+++ b/tp/Texinfo/XS/parsetexi/counter.h
@@ -35,6 +35,8 @@ int counter_value (COUNTER *c, ELEMENT *e);
void counter_reset (COUNTER *c, const char* not_empty_message);
int counter_element_value (COUNTER *c, ELEMENT *elt);
+void print_counter_top (COUNTER *c);
+
/* A large positive number used to represent an unlimited number of remaining
arguments. */
#define COUNTER_VARIADIC 32767
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/main/command_stack.c, tp/Texinfo/XS/parsetexi/counter.c (print_counter_top): debugging code.,
Patrice Dumas <=