From: Martin Hermant Date: Mon, 29 May 2017 17:28:48 +0000 (-0400) Subject: gen_external.py : relax a bit parsing of preprocessor code -> one line per {} block... X-Git-Tag: 0.4.6~52^2~21 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=15a43e083b1bbddd09066420a064f7b0a18064a4;p=aubio.git gen_external.py : relax a bit parsing of preprocessor code -> one line per {} block no matter if they are actually at end of line (conflict with structs) --- diff --git a/python/lib/gen_external.py b/python/lib/gen_external.py index 702b6fda..9df8f4bd 100644 --- a/python/lib/gen_external.py +++ b/python/lib/gen_external.py @@ -108,10 +108,13 @@ def get_cpp_objects(header=header, usedouble=False): i = 1 while 1: - if i >= len(cpp_output): break - if cpp_output[i-1].endswith(',') or cpp_output[i-1].endswith('{') or cpp_output[i].startswith('}'): + if i >= len(cpp_output):break + if ('{' in cpp_output[i - 1]) and (not '}' in cpp_output[i - 1]) or (not ';' in cpp_output[i - 1]): cpp_output[i] = cpp_output[i-1] + ' ' + cpp_output[i] cpp_output.pop(i-1) + elif ('}' in cpp_output[i]): + cpp_output[i] = cpp_output[i - 1] + ' ' + cpp_output[i] + cpp_output.pop(i - 1) else: i += 1