feat: error reporting for global reference usage
This commit is contained in:
parent
47351cd6f9
commit
be297047d1
8 changed files with 401 additions and 371 deletions
|
|
@ -27,6 +27,19 @@ test "compiler: global variable shadowing" {
|
|||
);
|
||||
}
|
||||
|
||||
test "compiler: invalid divert target" {
|
||||
try testEqual(
|
||||
\\-> foo
|
||||
\\
|
||||
\\VAR foo = 123
|
||||
,
|
||||
\\<STDIN>:1:4: error: invalid divert target
|
||||
\\1 | -> foo
|
||||
\\ | ^
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
fn testEqual(source_bytes: [:0]const u8, expected_error: []const u8) !void {
|
||||
const gpa = std.testing.allocator;
|
||||
var allocating = std.io.Writer.Allocating.init(gpa);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue