From 2500ea7605de4a0927eaaa87b8aec4dfce11bb30 Mon Sep 17 00:00:00 2001 From: Matheus Catarino Date: Sun, 1 Jun 2025 10:08:35 -0300 Subject: gen_d: fix d-doc comment replace '*' to '+' --- bindgen/gen_d.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bindgen') diff --git a/bindgen/gen_d.py b/bindgen/gen_d.py index b02cf0a8..634a4347 100644 --- a/bindgen/gen_d.py +++ b/bindgen/gen_d.py @@ -247,12 +247,14 @@ def format_comment(comment, indent="", multiline=False): if not comment: return comment = comment.strip() + # Escape nested comment delimiters to ensure valid D code + comment = comment.replace('/++', '/+ /').replace('+/', '/ +/') if multiline: - lines = textwrap.wrap(comment, width=80, subsequent_indent=indent + " * ") + lines = textwrap.wrap(comment, width=80, subsequent_indent=indent) l(f"{indent}/++") for line in lines: - l(f"{indent} * {line}") - l(f"{indent} +/") + l(f"{indent}+ {line}") + l(f"{indent}+/") else: for line in comment.split('\n'): l(f"{indent}/// {line.strip()}") -- cgit v1.2.3