stage2: print valid filename in error messages
This commit is contained in:
committed by
Andrew Kelley
parent
7140bb64e1
commit
d84b386f60
@@ -1111,6 +1111,11 @@ pub const Scope = struct {
|
||||
return buf.toOwnedSliceSentinel(0);
|
||||
}
|
||||
|
||||
/// Returns the full path to this file relative to its package.
|
||||
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 });
|
||||
|
||||
Reference in New Issue
Block a user