diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-02-02 17:58:20 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-02-15 01:43:17 +0300 |
commit | 583eddc3bf4c84f1ff7a88d4e3575835264208fa (patch) | |
tree | a9565db5b8a67d5f7bc4ec1a55a5b9e2ed4e717b /src/goto.h | |
parent | 2843ca269cb59bdf9c544fc5dec343bc7430cf3d (diff) | |
download | sciteco-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.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |