diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-02-01 02:14:19 -0800 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2020-02-01 02:14:19 -0800 |
commit | 136842b1ef18b850b518705ff3e6df3958f28e0c (patch) | |
tree | abcdddaf53bafd5e34e9aa278ffbe3d001b60cc4 /misc/py_wrap_generator.py | |
parent | 705e520a527864dc32f1934bb4b2b94d75f8f0ec (diff) | |
parent | a1c840ca5d6e8b580e21ae48550570aa9665741a (diff) | |
download | yosys-136842b1ef18b850b518705ff3e6df3958f28e0c.tar.gz yosys-136842b1ef18b850b518705ff3e6df3958f28e0c.tar.bz2 yosys-136842b1ef18b850b518705ff3e6df3958f28e0c.zip |
Merge branch 'master' into eddie/submod_po
Diffstat (limited to 'misc/py_wrap_generator.py')
-rw-r--r-- | misc/py_wrap_generator.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/misc/py_wrap_generator.py b/misc/py_wrap_generator.py index c58c3f66a..9b4e644c0 100644 --- a/misc/py_wrap_generator.py +++ b/misc/py_wrap_generator.py @@ -1935,6 +1935,19 @@ def parse_header(source): line = source_text[i].replace("YOSYS_NAMESPACE_BEGIN", " namespace YOSYS_NAMESPACE{").replace("YOSYS_NAMESPACE_END"," }") ugly_line = unpretty_string(line) + # for anonymous unions, ignore union enclosure by skipping start line and replacing end line with new line + if 'union {' in line: + j = i+1 + while j < len(source_text): + union_line = source_text[j] + if '};' in union_line: + source_text[j] = '\n' + break + j += 1 + if j != len(source_text): + i += 1 + continue + if str.startswith(ugly_line, "namespace "):# and ugly_line.find("std") == -1 and ugly_line.find("__") == -1: namespace_name = ugly_line[10:].replace("{","").strip() namespaces.append((namespace_name, ugly_line.count("{"))) |