mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
stage2: implement @src
This commit is contained in:
1 parent
4931b8dc93
commit
cc5c25d48b
5 files changed
+70
-8
No files matched your search
@@ -1663,6 +1663,11 @@ pub const File = struct {
|
||||
return file.pkg.root_src_directory.join(ally, &[_][]const u8{file.sub_file_path});
|
||||
}
|
||||
|
||||
/// Returns the full path to this file relative to its package.
|
||||
pub fn fullPathZ(file: File, ally: Allocator) ![:0]u8 {
|
||||
return file.pkg.root_src_directory.joinZ(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