Compilation: point caret in error message at the main token

This commit is contained in:
Veikka Tuominen
2022-07-15 11:38:16 +03:00
parent b5a838247b
commit 1463144fc8
5 changed files with 73 additions and 57 deletions

View File

@@ -174,6 +174,15 @@ pub fn addCases(ctx: *TestContext) !void {
});
}
{
const case = ctx.obj("missing semicolon at EOF", .{});
case.addError(
\\const foo = 1
, &[_][]const u8{
\\:1:14: error: expected ';' after declaration
});
}
// TODO test this in stage2, but we won't even try in stage1
//ctx.objErrStage1("inline fn calls itself indirectly",
// \\export fn foo() void {