From 291fb43f275b368f425380a3028068c7facafabb Mon Sep 17 00:00:00 2001 From: ippsav Date: Fri, 9 Aug 2024 00:52:40 +0100 Subject: [PATCH] fix(fmt): remove additional trailing newline --- tools/generate_linux_syscalls.zig | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/generate_linux_syscalls.zig b/tools/generate_linux_syscalls.zig index 07f9869eaf..f11633491e 100644 --- a/tools/generate_linux_syscalls.zig +++ b/tools/generate_linux_syscalls.zig @@ -587,13 +587,13 @@ fn generateSyscallsFromTable( if (arch_info.extra_values) |extra_values| { try writer.writeAll(extra_values); } - - try writer.writeAll("};\n\n"); + try writer.writeAll("};"); if (arch_info.additional_enum) |additional_enum| { + try writer.writeAll("\n\n"); try writer.print("pub const {s} = enum(usize) {{\n", .{additional_enum}); try writer.writeAll(optional_array_list.?.items); - try writer.writeAll("};\n\n"); + try writer.writeAll("};"); } } @@ -639,7 +639,7 @@ fn generateSyscallsFromPreprocessor( try writer.writeAll(extra_values); } - try writer.writeAll("};\n\n"); + try writer.writeAll("};"); } pub fn main() !void { @@ -671,7 +671,7 @@ pub fn main() !void { const buf = try allocator.alloc(u8, 1 << 15); defer allocator.free(buf); - inline for (arch_infos) |arch_info| { + inline for (arch_infos, 0..) |arch_info, i| { switch (arch_info) { .table => try generateSyscallsFromTable( allocator, @@ -689,6 +689,11 @@ pub fn main() !void { &arch_info, ), } + if (i < arch_infos.len - 1) { + try writer.writeAll("\n\n"); + } else { + try writer.writeAll("\n"); + } } try buf_out.flush();