aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parser.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-13 01:31:49 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-13 01:49:22 +0200
commita9224ebee3b6458dee42d76ec76b1a704e206107 (patch)
tree5582c794f37cd092a987ce8dc9ae49723d46a1a0 /src/parser.c
parentc2057ebf7e2a34eccd615a7d88085e247e5b9e9f (diff)
downloadsciteco-a9224ebee3b6458dee42d76ec76b1a704e206107.tar.gz
remaining types of program counters changed to gsize/gssize
* This fixes F< to the beginning of the macro, which was broken in 73d574b71a10d4661ada20275cafde75aff6c1ba. teco_machine_main_t::macro_pc actually has to be signed as it is sometimes set to -1.
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/parser.c b/src/parser.c
index 3c37f81..45e31cf 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -102,12 +102,6 @@ gboolean
teco_machine_main_step(teco_machine_main_t *ctx, const gchar *macro, gsize stop_pos, GError **error)
{
while (ctx->macro_pc < stop_pos) {
-#ifdef DEBUG
- g_printf("EXEC(%d): input='%c'/%x, state=%p, mode=%d\n",
- ctx->macro_pc, macro[ctx->macro_pc], macro[ctx->macro_pc],
- ctx->parent.current, ctx->mode);
-#endif
-
if (G_UNLIKELY(teco_interface_is_interrupted())) {
teco_error_interrupted_set(error);
goto error_attach;
@@ -123,6 +117,11 @@ teco_machine_main_step(teco_machine_main_t *ctx, const gchar *macro, gsize stop_
/* UTF-8 sequences are already validated */
gunichar chr = g_utf8_get_char(macro+ctx->macro_pc);
+#ifdef DEBUG
+ g_printf("EXEC(%d): input='%C' (U+%04" G_GINT32_MODIFIER "X), state=%p, mode=%d\n",
+ ctx->macro_pc, chr, chr, ctx->parent.current, ctx->mode);
+#endif
+
if (!teco_machine_input(&ctx->parent, chr, error))
goto error_attach;