1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-23 04:43:57 +01:00

adapt the generator for arrays of strings [text]

This commit is contained in:
q-posev 2021-06-11 14:45:42 +02:00
parent 13b8d24108
commit b67d1c2cb2

View File

@ -306,6 +306,11 @@ def special_populate_text_group(fname: str, paths: dict, group_dict: dict, detai
if group != detailed_dset[dset]['group']: if group != detailed_dset[dset]['group']:
continue continue
if ('REPEAT GROUP_DSET_STR' in line) and (detailed_dset[dset]['dtype'] != 'char*'):
continue
if ('REPEAT GROUP_DSET_NUM' in line) and (detailed_dset[dset]['dtype'] == 'char*'):
continue
dset_allocated.append(dset) dset_allocated.append(dset)
if 'FREE($group$->$group_dset$)' in loop_body: if 'FREE($group$->$group_dset$)' in loop_body:
@ -313,7 +318,7 @@ def special_populate_text_group(fname: str, paths: dict, group_dict: dict, detai
for dset_alloc in dset_allocated: for dset_alloc in dset_allocated:
tmp_string += f'FREE({group}->{dset_alloc});\n ' tmp_string += f'FREE({group}->{dset_alloc});\n '
tmp_body = loop_body.replace('FREE($group$->$group_dset$);',tmp_string) tmp_body = loop_body.replace('FREE($group$->$group_dset$);', tmp_string)
populated_body = recursive_replace_line(tmp_body, triggers, detailed_dset[dset]) populated_body = recursive_replace_line(tmp_body, triggers, detailed_dset[dset])
f_out.write(populated_body) f_out.write(populated_body)