aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/parser.c b/src/parser.c
index 8b02764..8ec051e 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -104,6 +104,9 @@ teco_machine_main_step(teco_machine_main_t *ctx, const gchar *macro, gsize stop_
{
gsize last_pc = 0;
+ ctx->macro = macro;
+ ctx->stop_pos = stop_pos;
+
while (ctx->macro_pc < stop_pos) {
last_pc = ctx->macro_pc;
@@ -1091,7 +1094,7 @@ teco_state_expectstring_input(teco_machine_main_t *ctx, gunichar chr, GError **e
* as allowing whitespace escape_chars is harmful.
*/
if (ctx->flags.modifier_at && teco_is_noop(chr))
- return current;
+ TECO_RETURN(ctx, current, error);
/*
* String termination handling
@@ -1106,7 +1109,7 @@ teco_state_expectstring_input(teco_machine_main_t *ctx, gunichar chr, GError **e
if (ctx->parent.must_undo)
teco_undo_gunichar(ctx->expectstring.machine.escape_char);
ctx->expectstring.machine.escape_char = g_unichar_toupper(chr);
- return current;
+ TECO_RETURN(ctx, current, error);
}
/*
@@ -1177,7 +1180,7 @@ teco_state_expectstring_input(teco_machine_main_t *ctx, gunichar chr, GError **e
if (ctx->parent.must_undo)
teco_undo_gsize(ctx->expectstring.insert_len);
ctx->expectstring.insert_len = 0;
- return next;
+ TECO_RETURN(ctx, next, error);
}
/*
@@ -1213,7 +1216,7 @@ teco_state_expectstring_input(teco_machine_main_t *ctx, gunichar chr, GError **e
teco_undo_gsize(ctx->expectstring.insert_len);
ctx->expectstring.insert_len += ctx->expectstring.string.len - old_len;
- return current;
+ TECO_RETURN(ctx, current, error);
}
gboolean