aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/goto.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-02-02 17:58:20 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-02-15 01:43:17 +0300
commit583eddc3bf4c84f1ff7a88d4e3575835264208fa (patch)
treea9565db5b8a67d5f7bc4ec1a55a5b9e2ed4e717b /src/goto.h
parent2843ca269cb59bdf9c544fc5dec343bc7430cf3d (diff)
downloadsciteco-583eddc3bf4c84f1ff7a88d4e3575835264208fa.tar.gz
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
Diffstat (limited to 'src/goto.h')
-rw-r--r--src/goto.h6
1 files changed, 3 insertions, 3 deletions
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