From 583eddc3bf4c84f1ff7a88d4e3575835264208fa Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 2 Feb 2025 17:58:20 +0300 Subject: redefining labels is a warning now * Allowing label redefinitions might have been useful when used as comments, since you will want to be able to define arbitrary comments. However as flow control constructs, this introduced a certain ambiguity since gotos might jump to different locations, depending on the progression of the parser. * On the other hand, making label redefinition an error might disqualify labels as comments when writing or porting classic TECO code. Therefore, it has been made a warning as a compromise. * Added test case --- src/goto.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/goto.h') diff --git a/src/goto.h b/src/goto.h index 49007fb..eda823f 100644 --- a/src/goto.h +++ b/src/goto.h @@ -40,12 +40,12 @@ teco_goto_table_init(teco_goto_table_t *ctx, gboolean must_undo) ctx->must_undo = must_undo; } -gssize teco_goto_table_remove(teco_goto_table_t *ctx, const gchar *name, gsize len); +gboolean teco_goto_table_remove(teco_goto_table_t *ctx, const gchar *name, gsize len); +void teco_goto_table_undo_remove(teco_goto_table_t *ctx, const gchar *name, gsize len); gssize teco_goto_table_find(teco_goto_table_t *ctx, const gchar *name, gsize len); -gssize teco_goto_table_set(teco_goto_table_t *ctx, const gchar *name, gsize len, gssize pc); -void teco_goto_table_undo_set(teco_goto_table_t *ctx, const gchar *name, gsize len, gssize pc); +gssize teco_goto_table_set(teco_goto_table_t *ctx, const gchar *name, gsize len, gsize pc); /** @memberof teco_goto_table_t */ static inline gboolean -- cgit v1.2.3