ref: 15a43e083b1bbddd09066420a064f7b0a18064a4
parent: deaf39e47851897f32c747929aa82da7dd197116
author: Martin Hermant <martin.hermant@gmail.com>
date: Mon May 29 09:28:48 EDT 2017
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)
--- a/python/lib/gen_external.py
+++ b/python/lib/gen_external.py
@@ -108,10 +108,13 @@
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