From ee787e25db280a4441e3db1f8cb0ddf59985487c Mon Sep 17 00:00:00 2001 From: Alexander Arvidsson <2972103+AlexanderArvidsson@users.noreply.github.com> Date: Wed, 8 Jan 2025 00:03:04 +0100 Subject: [PATCH] bindgen(zig): Fix empty comment leading whitespace --- bindgen/gen_zig.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bindgen/gen_zig.py b/bindgen/gen_zig.py index 6229d019f..446585e48 100644 --- a/bindgen/gen_zig.py +++ b/bindgen/gen_zig.py @@ -129,8 +129,9 @@ def l(s): def c(s, indent=""): if not s: return - prefix = f"{indent}/// " - l(textwrap.indent(textwrap.dedent(s), prefix=prefix, predicate=lambda line: True)) + prefix = f"{indent}///" + for line in textwrap.dedent(s).splitlines(): + l(f"{prefix} {line}" if line else prefix ) def as_zig_prim_type(s): return prim_types[s]