diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/make_free_functions.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/make_free_functions.py b/scripts/make_free_functions.py index b3fa023b..68126468 100644 --- a/scripts/make_free_functions.py +++ b/scripts/make_free_functions.py @@ -25,12 +25,14 @@ for header in glob.glob("../include/afio/*/*.hpp"): raise Exception() if '{' in lines[lineidx+n+1] or ';' in lines[lineidx+n]: break - for n in range(1, 100): - if '//!' in lines[lineidx-n] or '/*!' in lines[lineidx-n]: - docs = ''.join(lines[lineidx-n:lineidx]) - # Remove any indent - docs = docs.replace('\n ', '\n')[2:] - break + docs = '' + if '*/' in lines[lineidx-1] or '//!' in lines[lineidx-1]: + for n in range(1, 100): + if '//!' in lines[lineidx-n] or '/*!' in lines[lineidx-n]: + docs = ''.join(lines[lineidx-n:lineidx]) + # Remove any indent + docs = docs.replace('\n ', '\n')[2:] + break functions_to_be_freed.append((current_class, function, docs)) elif '// BEGIN make_free_functions.py' in lines[lineidx]: functions_to_be_freed_begin = lineidx |