diff options
| author | Matheus Catarino <matheus-catarino@hotmail.com> | 2025-06-01 10:08:35 -0300 |
|---|---|---|
| committer | Matheus Catarino <matheus-catarino@hotmail.com> | 2025-06-01 10:08:35 -0300 |
| commit | 2500ea7605de4a0927eaaa87b8aec4dfce11bb30 (patch) | |
| tree | d92a6cfd5d308531e147c49756435bc3c416c971 /bindgen | |
| parent | b00d47d0c35dea6e5e8f8d5847f26f0be66dc3ef (diff) | |
gen_d: fix d-doc comment
replace '*' to '+'
Diffstat (limited to 'bindgen')
| -rw-r--r-- | bindgen/gen_d.py | 8 |
1 files changed, 5 insertions, 3 deletions
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()}") |