diff options
| author | Robin Voetter <robin@voetter.nl> | 2022-01-08 04:29:49 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-01-08 14:32:40 -0500 |
| commit | cc5c25d48b5331396bfa5218dc7f29dff26e20f9 (patch) | |
| tree | 08767d5933f36d6bc57cc284ed62ac9ca0d625c4 /src/Module.zig | |
| parent | 4931b8dc93ee4a99a415dffab03d400e95d1a90a (diff) | |
| download | zig-cc5c25d48b5331396bfa5218dc7f29dff26e20f9.tar.gz zig-cc5c25d48b5331396bfa5218dc7f29dff26e20f9.zip | |
stage2: implement @src
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig index 643e793206..e93fe2549c 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -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 }); |
