blob: 9db082a8796dd3abb7f78f7c209a7f70367676f0 [file]
#!/usr/bin/python3
import re
# The JSON Yosys outputs isn't acutally compliant JSON, as it contains C-style
# comments. These must be stripped.
def strip_yosys_json(text):
stripped = re.sub(r'\\\n', '', text)
stripped = re.sub(r'//.*\n', '\n', stripped)
stripped = re.sub(r'/\*.*\*/', '', stripped)
return stripped