fhdl: allow None statements

This commit is contained in:
Sebastien Bourdeauducq 2012-01-15 17:45:54 +01:00
parent 85491efc68
commit aa8b8da684
2 changed files with 9 additions and 3 deletions

View File

@ -26,7 +26,9 @@ class Namespace:
return sig.name return sig.name
def list_signals(node): def list_signals(node):
if isinstance(node, Constant): if node is None:
return set()
elif isinstance(node, Constant):
return set() return set()
elif isinstance(node, Signal): elif isinstance(node, Signal):
return {node} return {node}
@ -56,7 +58,9 @@ def list_signals(node):
raise TypeError raise TypeError
def list_targets(node): def list_targets(node):
if isinstance(node, Signal): if node is None:
return set()
elif isinstance(node, Signal):
return {node} return {node}
elif isinstance(node, _Slice): elif isinstance(node, _Slice):
return list_targets(node.value) return list_targets(node.value)

View File

@ -49,7 +49,9 @@ def _printexpr(ns, node):
(_AT_BLOCKING, _AT_NONBLOCKING, _AT_SIGNAL) = range(3) (_AT_BLOCKING, _AT_NONBLOCKING, _AT_SIGNAL) = range(3)
def _printnode(ns, at, level, node): def _printnode(ns, at, level, node):
if isinstance(node, _Assign): if node is None:
return ""
elif isinstance(node, _Assign):
if at == _AT_BLOCKING: if at == _AT_BLOCKING:
assignment = " = " assignment = " = "
elif at == _AT_NONBLOCKING: elif at == _AT_NONBLOCKING: