diff options
| author | Alexander Arvidsson <2972103+AlexanderArvidsson@users.noreply.github.com> | 2025-01-05 09:55:57 +0100 |
|---|---|---|
| committer | Alexander Arvidsson <2972103+AlexanderArvidsson@users.noreply.github.com> | 2025-01-05 09:55:57 +0100 |
| commit | 03e12ea7a6d61ea277ffab820a81a4fa573572e3 (patch) | |
| tree | 6a47b7e9b5a28e602ad1861f50982e9420ccba34 /bindgen | |
| parent | 3cb0ddb539e0bd8c0f4abf5621a32ebe5d3fa63d (diff) | |
bindgen: Remove unnecessary 'comment_multiline'
Diffstat (limited to 'bindgen')
| -rw-r--r-- | bindgen/gen_ir.py | 3 | ||||
| -rw-r--r-- | bindgen/gen_odin.py | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/bindgen/gen_ir.py b/bindgen/gen_ir.py index 558392ae..3b3947e4 100644 --- a/bindgen/gen_ir.py +++ b/bindgen/gen_ir.py @@ -45,7 +45,6 @@ def parse_struct(decl, source): for item_decl in decl['inner']: if item_decl['kind'] == 'FullComment': outp['comment'] = extract_comment(item_decl, source) - outp['comment_multiline'] = '\n' in outp['comment'] continue if item_decl['kind'] != 'FieldDecl': sys.exit(f"ERROR: Structs must only contain simple fields ({decl['name']})") @@ -69,7 +68,6 @@ def parse_enum(decl, source): for item_decl in decl['inner']: if item_decl['kind'] == 'FullComment': outp['comment'] = extract_comment(item_decl, source) - outp['comment_multiline'] = '\n' in outp['comment'] continue if item_decl['kind'] == 'EnumConstantDecl': item = {} @@ -101,7 +99,6 @@ def parse_func(decl, source): for param in decl['inner']: if param['kind'] == 'FullComment': outp['comment'] = extract_comment(param, source) - outp['comment_multiline'] = '\n' in outp['comment'] continue if param['kind'] != 'ParmVarDecl': print(f" >> warning: ignoring func {decl['name']} (unsupported parameter type)") diff --git a/bindgen/gen_odin.py b/bindgen/gen_odin.py index f66dcebb..6e2a5e32 100644 --- a/bindgen/gen_odin.py +++ b/bindgen/gen_odin.py @@ -428,7 +428,7 @@ def gen_c_imports(inp, c_prefix, prefix): res_type = funcdecl_result_c(decl, prefix) res_str = '' if res_type == '' else f'-> {res_type}' if decl.get('comment'): - if decl.get('comment_multiline'): + if '\n' in decl["comment"]: l(" /*") l(" " + " ".join(decl['comment'].splitlines(True))) l(" */") @@ -453,7 +453,7 @@ def gen_struct(decl, prefix): c_struct_name = check_override(decl['name']) struct_name = as_struct_or_enum_type(c_struct_name, prefix) if decl.get('comment'): - if decl.get('comment_multiline'): + if '\n' in decl["comment"]: l("/*") l(decl["comment"]) l("*/") @@ -474,7 +474,7 @@ def gen_struct(decl, prefix): def gen_enum(decl, prefix): enum_name = check_override(decl['name']) if decl.get('comment'): - if decl.get('comment_multiline'): + if '\n' in decl["comment"]: l("/*") l(decl["comment"]) l("*/") |