compat.fhdl.structure: fix Case().makedefault().

Fixes #100.
This commit is contained in:
whitequark 2019-06-13 03:54:46 +00:00
parent f689b777b4
commit 2566747061

View file

@ -105,7 +105,7 @@ class Case(ast.Switch):
or (isinstance(choice, str) and choice == "default")
or choice > key):
key = choice
if isinstance(key, str) and key == "default":
elif isinstance(key, str) and key == "default":
key = "-" * len(self.test)
else:
key = "{:0{}b}".format(wrap(key).value, len(self.test))