diff options
-rw-r--r-- | src/vhdl/python/libghdl/thin.py | 1 | ||||
-rw-r--r-- | src/vhdl/python/libghdl/thinutils.py | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/vhdl/python/libghdl/thin.py b/src/vhdl/python/libghdl/thin.py index d16475cc6..b8ebc7355 100644 --- a/src/vhdl/python/libghdl/thin.py +++ b/src/vhdl/python/libghdl/thin.py @@ -108,6 +108,7 @@ _Get_Identifier_With_Len = libghdl.name_table__get_identifier_with_len def Get_Identifier(s): return _Get_Identifier_With_Len(c_char_p(s), len(s)) +Null_Identifier = 0 # Ieee diff --git a/src/vhdl/python/libghdl/thinutils.py b/src/vhdl/python/libghdl/thinutils.py index 93f00b8ba..85edafbff 100644 --- a/src/vhdl/python/libghdl/thinutils.py +++ b/src/vhdl/python/libghdl/thinutils.py @@ -194,6 +194,7 @@ def declarations_iter(n): if n1 != Null_Iir: for n2 in declarations_iter(n1): yield n2 + # All these nodes are handled: if k in [iirs.Iir_Kind.Entity_Declaration, iirs.Iir_Kind.Architecture_Body, iirs.Iir_Kind.Package_Declaration, @@ -248,7 +249,11 @@ def declarations_iter(n): def concurrent_stmts_iter(n): """Iterator on concurrent statements in n.""" k = iirs.Get_Kind(n) - if k == iirs.Iir_Kind.Design_Unit: + if k == iirs.Iir_Kind.Design_File: + for n1 in chain_iter(iirs.Get_First_Design_Unit(n)): + for n2 in concurrent_stmts_iter(n1): + yield n2 + elif k == iirs.Iir_Kind.Design_Unit: for n1 in concurrent_stmts_iter(iirs.Get_Library_Unit(n)): yield n1 elif k == iirs.Iir_Kind.Entity_Declaration \ |