Changeset 15a43e0


Ignore:
Timestamp:
May 29, 2017, 7:28:48 PM (7 years ago)
Author:
Martin Hermant <martin.hermant@gmail.com>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
Children:
5674833
Parents:
deaf39e
Message:

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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_external.py

    rdeaf39e r15a43e0  
    109109    i = 1
    110110    while 1:
    111         if i >= len(cpp_output): break
    112         if cpp_output[i-1].endswith(',') or cpp_output[i-1].endswith('{') or cpp_output[i].startswith('}'):
     111        if i >= len(cpp_output):break
     112        if ('{' in cpp_output[i - 1]) and (not '}' in cpp_output[i - 1]) or (not ';' in cpp_output[i - 1]):
    113113            cpp_output[i] = cpp_output[i-1] + ' ' + cpp_output[i]
    114114            cpp_output.pop(i-1)
     115        elif ('}' in cpp_output[i]):
     116            cpp_output[i] = cpp_output[i - 1] + ' ' + cpp_output[i]
     117            cpp_output.pop(i - 1)
    115118        else:
    116119            i += 1
Note: See TracChangeset for help on using the changeset viewer.