diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-10-19 20:40:03 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-10-19 20:40:03 +0200 |
commit | ae229644603a6837ed38e0580abd9e2a80d26906 (patch) | |
tree | 45e86eca47d6fbde03f5d29247c9f78fb92065cb | |
parent | 2a598d007afa60ead63faa86214e6814f103fdd4 (diff) | |
download | ghdl-ae229644603a6837ed38e0580abd9e2a80d26906.tar.gz ghdl-ae229644603a6837ed38e0580abd9e2a80d26906.tar.bz2 ghdl-ae229644603a6837ed38e0580abd9e2a80d26906.zip |
python: handle attributes in declarations_iter.
-rw-r--r-- | src/vhdl/python/libghdl/thin.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/vhdl/python/libghdl/thin.py b/src/vhdl/python/libghdl/thin.py index 07a5e80d6..aa25beb1d 100644 --- a/src/vhdl/python/libghdl/thin.py +++ b/src/vhdl/python/libghdl/thin.py @@ -268,10 +268,13 @@ def declarations_iter(n): yield n1 if nodes_meta.Has_Declaration_Chain(k): for n1 in chain_iter(iirs.Get_Declaration_Chain(n)): - yield n1 - # There can be nested declarations (subprograms, record elements) - for n2 in declarations_iter(n1): - yield n2 + k1 = iirs.Get_Kind(n1) + if k1 != iirs.Iir_Kind.Attribute_Specification: + yield n1 + # There can be nested declarations (subprograms, + # record elements) + for n2 in declarations_iter(n1): + yield n2 if nodes_meta.Has_Concurrent_Statement_Chain(k): for n1 in chain_iter(iirs.Get_Concurrent_Statement_Chain(n)): for n2 in declarations_iter(n1): @@ -323,6 +326,7 @@ def declarations_iter(n): iirs.Iir_Kind.Constant_Declaration, iirs.Iir_Kind.Variable_Declaration, iirs.Iir_Kind.Object_Alias_Declaration, + iirs.Iir_Kind.Attribute_Declaration, iirs.Iir_Kind.If_Statement, iirs.Iir_Kind.Elsif, iirs.Iir_Kind.Return_Statement, |