From 511aa3c5a9f2700932a21ba9884783cff0cecf95 Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Wed, 20 Oct 2021 17:35:41 +0100 Subject: [PATCH] Improved error message for unrecognised token --- etc/asma-test.sh | 2 +- projects/library/asma.tal | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/asma-test.sh b/etc/asma-test.sh index 97ccf27..6d88124 100755 --- a/etc/asma-test.sh +++ b/etc/asma-test.sh @@ -51,7 +51,7 @@ expect_failure 'Address outside range: ,hello' <<'EOD' |1000 @hello |2000 ,hello EOD -expect_failure 'Label not found: hello' <<'EOD' +expect_failure 'Unrecognised token: hello' <<'EOD' hello EOD expect_failure 'Macro already exists: %me' <<'EOD' diff --git a/projects/library/asma.tal b/projects/library/asma.tal index 8677755..bd4f8f3 100644 --- a/projects/library/asma.tal +++ b/projects/library/asma.tal @@ -790,7 +790,7 @@ include projects/library/heap.tal JMP2r ¬-include - ;asma-msg-label ;asma/error STA2 + ;asma-msg-token ;asma/error STA2 JMP2r &too-deep @@ -813,6 +813,7 @@ include projects/library/heap.tal @asma-msg-zero-page "Address 20 "not 20 "in 20 "zero 20 "page 00 @asma-msg-relative "Address 20 "outside 20 "range 00 @asma-msg-label "Label 20 "not 20 "found 00 +@asma-msg-token "Unrecognised 20 "token 00 @asma-msg-macro "Macro 20 "already 20 "exists 00 @asma-msg-rewound "Memory 20 "overwrite 00 @asma-msg-too-deep "Recursion 20 "level 20 "too 20 "deep 00