Improve error message
This commit is contained in:
parent
a1e5d310a9
commit
45f7ccbe28
1 changed files with 4 additions and 1 deletions
5
revbank
5
revbank
|
@ -215,7 +215,10 @@ OUTER: for (;;) {
|
||||||
@retry = @words = ();
|
@retry = @words = ();
|
||||||
$retry = "Syntax error.";
|
$retry = "Syntax error.";
|
||||||
if ($input =~ /['"]/) {
|
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, 0, $pos) if $pos > 0;
|
||||||
push @retry, substr($input, $pos);
|
push @retry, substr($input, $pos);
|
||||||
|
|
Loading…
Add table
Reference in a new issue