Include package root dir in stage2 error messages

This commit is contained in:
J.C. Moyer
2021-06-24 01:41:54 -04:00
committed by Veikka Tuominen
parent f398ac3ee4
commit 15a030ef3d
2 changed files with 10 additions and 6 deletions

View File

@@ -1111,6 +1111,10 @@ pub const Scope = struct {
return buf.toOwnedSliceSentinel(0);
}
pub fn fullPath(file: File, ally: *Allocator) ![]u8 {
return file.pkg.root_src_directory.join(ally, &[_][]const u8{file.sub_file_path});
}
pub fn dumpSrc(file: *File, src: LazySrcLoc) void {
const loc = std.zig.findLineColumn(file.source.bytes, src);
std.debug.print("{s}:{d}:{d}\n", .{ file.sub_file_path, loc.line + 1, loc.column + 1 });