From 45f7ccbe28b845e727df5d9e5fd6fb1d3b9e261c Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Tue, 26 Dec 2023 04:06:22 +0100 Subject: [PATCH] Improve error message --- revbank | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/revbank b/revbank index 2693145..1d750a3 100755 --- a/revbank +++ b/revbank @@ -215,7 +215,10 @@ OUTER: for (;;) { @retry = @words = (); $retry = "Syntax error."; if ($input =~ /['"]/) { - $retry .= " (Quotes must be at beginning and end of terms only.)"; + $retry .= " (Quotes must match and (only) be at both ends of a term.)"; + if (($input =~ tr/'//) == 1 and $input !~ /"/) { + $retry .= "\nDid you mean: " . $input =~ s/'/\\'/r; + } } push @retry, substr($input, 0, $pos) if $pos > 0; push @retry, substr($input, $pos);