Merge branch 'master' into zig-0.15

This commit is contained in:
CJ van den Berg 2025-09-24 18:33:33 +02:00
commit 96e8100373
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
24 changed files with 894 additions and 145 deletions

View file

@ -255,19 +255,34 @@ pub fn main() anyerror!void {
defer links.deinit();
var prev: ?*file_link.Dest = null;
var line_next: ?usize = null;
var offset_next: ?usize = null;
for (args.positional.trailing.items) |arg| {
if (arg.len == 0) continue;
if (!args.literal and arg[0] == '+') {
const line = try std.fmt.parseInt(usize, arg[1..], 10);
if (prev) |p| switch (p.*) {
.file => |*file| {
file.line = line;
continue;
},
else => {},
};
line_next = line;
if (arg.len > 2 and arg[1] == 'b') {
const offset = try std.fmt.parseInt(usize, arg[2..], 10);
if (prev) |p| switch (p.*) {
.file => |*file| {
file.offset = offset;
continue;
},
else => {},
};
offset_next = offset;
line_next = null;
} else {
const line = try std.fmt.parseInt(usize, arg[1..], 10);
if (prev) |p| switch (p.*) {
.file => |*file| {
file.line = line;
continue;
},
else => {},
};
line_next = line;
offset_next = null;
}
continue;
}
@ -284,6 +299,15 @@ pub fn main() anyerror!void {
else => {},
}
}
if (offset_next) |offset| {
switch (curr.*) {
.file => |*file| {
file.offset = offset;
offset_next = null;
},
else => {},
}
}
}
var have_project = false;