aboutsummaryrefslogtreecommitdiff
path: root/bindgen/gen_d.py
diff options
context:
space:
mode:
authorMatheus Catarino <matheus-catarino@hotmail.com>2025-06-01 10:40:19 -0300
committerMatheus Catarino <matheus-catarino@hotmail.com>2025-06-01 10:40:19 -0300
commit941f8ee4d7307aca892795197b27b4bbb662451b (patch)
tree255c68ea7dfde04d01b6eee31601fbe8d6c61e36 /bindgen/gen_d.py
parent2500ea7605de4a0927eaaa87b8aec4dfce11bb30 (diff)
gen_d: fixing d-doc format
Diffstat (limited to 'bindgen/gen_d.py')
-rw-r--r--bindgen/gen_d.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bindgen/gen_d.py b/bindgen/gen_d.py
index 634a4347..569ac628 100644
--- a/bindgen/gen_d.py
+++ b/bindgen/gen_d.py
@@ -250,7 +250,8 @@ def format_comment(comment, indent="", multiline=False):
# Escape nested comment delimiters to ensure valid D code
comment = comment.replace('/++', '/+ /').replace('+/', '/ +/')
if multiline:
- lines = textwrap.wrap(comment, width=80, subsequent_indent=indent)
+ # Split by newlines to preserve empty lines
+ lines = [line.rstrip() for line in comment.split('\n')]
l(f"{indent}/++")
for line in lines:
l(f"{indent}+ {line}")
@@ -403,9 +404,12 @@ def gen_module(inp, dep_prefixes, c_header_path):
reset_globals()
header_comment = f"""
Machine generated D bindings for Sokol library.
+
Generated on: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}
+
Source header: {os.path.basename(c_header_path)}
Module: sokol.{inp['module']}
+
Do not edit manually; regenerate using gen_d.py.
"""
format_comment(header_comment, multiline=True)