From: Clifford Wolf Date: Fri, 19 Jan 2018 13:26:42 +0000 (+0100) Subject: Improve handling of comments in .sby files X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=221c8d24d707b904806270337dff0e51cb7b4d0c;p=SymbiYosys.git Improve handling of comments in .sby files --- diff --git a/sbysrc/sby_core.py b/sbysrc/sby_core.py index 9808485..10b45fd 100644 --- a/sbysrc/sby_core.py +++ b/sbysrc/sby_core.py @@ -188,12 +188,14 @@ class SbyJob: with open("%s/config.sby" % workdir, "r") as f: for line in f: raw_line = line - line = line.strip() + if mode in ["options", "engines", "files"]: + line = re.sub(r"\s*(\s#.*)?$", "", line) + if line == "" or line[0] == "#": + continue + else: + line = line.rstrip() # print(line) - if line == "" or line[0] == "#": - continue - match = re.match(r"^\s*\[(.*)\]\s*$", line) if match: entries = match.group(1).split()