From 15a43e083b1bbddd09066420a064f7b0a18064a4 Mon Sep 17 00:00:00 2001 From: Martin Hermant Date: Mon, 29 May 2017 13:28:48 -0400 Subject: [PATCH] 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) --- python/lib/gen_external.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.11.0