aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
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 /tests
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 'tests')
-rw-r--r--tests/testsuite.at8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at
index f17a711..3f0b7e5 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -270,6 +270,14 @@ AT_SETUP([Jump to beginning of macro])
AT_CHECK([$SCITECO -e "%a-2\"< F< ' Qa-2\"N(0/0)'"], 0, ignore, ignore)
AT_CLEANUP
+AT_SETUP([Gotos and labels])
+# Not a label redefinition, there must not even be a warning.
+AT_CHECK([$SCITECO -e '2<!foo!>'], 0, ignore, stderr)
+AT_FAIL_IF([$GREP "^Warning:" stderr])
+# Will print a warning about label redefinition, though...
+AT_CHECK([$SCITECO -e "!foo! Qa\"S^C' !foo! Qa\"S(0/0)' -Ua @O/foo/"], 0, ignore, ignore)
+AT_CLEANUP
+
#
# Command-line editing bugs.
#