tools: fix some bitrot

This commit is contained in:
Alex Rønne Petersen
2025-07-16 06:08:54 +02:00
parent 9a69aede0e
commit 2ffa63acef
9 changed files with 75 additions and 83 deletions

View File

@@ -635,7 +635,7 @@ pub fn main() anyerror!void {
const args = try std.process.argsAlloc(allocator);
var stdout_buffer: [4000]u8 = undefined;
var stdout_writer = fs.stdout().writerStreaming(&stdout_buffer);
var stdout_writer = fs.File.stdout().writerStreaming(&stdout_buffer);
const stdout = &stdout_writer.interface;
if (args.len <= 1) printUsageAndExit(args[0]);
@@ -767,7 +767,7 @@ pub fn main() anyerror!void {
try stdout.print(
\\.{{
\\ .name = "{s}",
\\ .syntax = {s},
\\ .syntax = {f},
\\ .zig_equivalent = .{s},
\\ .pd1 = {},
\\ .pd2 = {},
@@ -797,7 +797,7 @@ pub fn main() anyerror!void {
try stdout.print(
\\.{{
\\ .name = "{s}",
\\ .syntax = {s},
\\ .syntax = {f},
\\ .zig_equivalent = .other,
\\ .pd1 = {},
\\ .pd2 = {},
@@ -845,14 +845,10 @@ const Syntax = union(enum) {
pub fn format(
self: Syntax,
comptime fmt: []const u8,
options: std.fmt.FormatOptions,
out_stream: anytype,
) !void {
_ = fmt;
_ = options;
out_stream: *std.Io.Writer,
) std.Io.Writer.Error!void {
switch (self) {
.multi_arg => |n| return out_stream.print(".{{.{s}={}}}", .{ @tagName(self), n }),
.multi_arg => |n| return out_stream.print(".{{.{t}={d}}}", .{ self, n }),
else => return out_stream.print(".{s}", .{@tagName(self)}),
}
}