From 9a208575a8e2f3c27d5ace226993c95fd0ad83d5 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Tue, 20 Jan 2026 10:04:29 -0800 Subject: [PATCH] give feedback about variable potentially using wrong case --- lib/Parser/Variable.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Parser/Variable.pm b/lib/Parser/Variable.pm index eba73a666a..11ec7f204b 100644 --- a/lib/Parser/Variable.pm +++ b/lib/Parser/Variable.pm @@ -26,6 +26,14 @@ sub new { $ref->[3] = $ref->[2] + length($1); $equation->Error([ "'%s' is not defined in this context", $1 ], $ref); } + my ($iname) = grep {/^$name$/i} $equation->{context}->variables->variables; + $equation->Error( + [ + "Variable '%s' is not defined in this context, but perhaps you mean '%s', which is defined", + $name, $iname + ], + $ref + ) if $iname; $equation->Error([ "Variable '%s' is not defined in this context", $name ], $ref); } $equation->Error([ "Variable '%s' is not defined in this context", $name ], $ref)