fix: error reporting for global variables

This commit is contained in:
Brett Broadhurst 2026-03-25 23:50:42 -06:00
parent 2dfa6cd842
commit 9ca2200448
Failed to generate hash of commit
5 changed files with 80 additions and 55 deletions

View file

@ -6,7 +6,7 @@ test "compiler: unknown global variable" {
try testEqual(
\\{a}
,
\\<STDIN>:1:2: error: unknown global variable
\\<STDIN>:1:2: error: unknown identifier
\\1 | {a}
\\ | ^
\\
@ -20,7 +20,7 @@ test "compiler: global variable shadowing" {
\\VAR b = 2
\\VAR a = 1
,
\\<STDIN>:3:1: error: redefined identifier
\\<STDIN>:3:1: error: duplicate identifier
\\3 | VAR a = 1
\\ | ^
\\