diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-06-22 18:51:27 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-06-22 18:51:27 +0200 |
commit | bcd26f428e704eef5ef665bea7448f3990b5e010 (patch) | |
tree | 0f4e46bc2c01e741bec8203d16ffcb8110ac2135 | |
parent | 25a3580831170f8a0acd0a79aca2c94ea4652338 (diff) | |
download | ghdl-bcd26f428e704eef5ef665bea7448f3990b5e010.tar.gz ghdl-bcd26f428e704eef5ef665bea7448f3990b5e010.tar.bz2 ghdl-bcd26f428e704eef5ef665bea7448f3990b5e010.zip |
pyGHDL/dom/_Utils.py: add assert, adjust previous commit
-rw-r--r-- | pyGHDL/dom/_Utils.py | 2 | ||||
-rw-r--r-- | pyGHDL/libghdl/vhdl/nodes.py | 2 | ||||
-rwxr-xr-x | scripts/pnodespy.py | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/pyGHDL/dom/_Utils.py b/pyGHDL/dom/_Utils.py index 38a85c0c3..0e0cbc95b 100644 --- a/pyGHDL/dom/_Utils.py +++ b/pyGHDL/dom/_Utils.py @@ -53,6 +53,8 @@ __MODE_TRANSLATION = { @export def GetIirKindOfNode(node: Iir) -> nodes.Iir_Kind: + # This function is the most likely to be called on a Null_Iir node + assert node != 0 kind: int = nodes.Get_Kind(node) return nodes.Iir_Kind(kind) diff --git a/pyGHDL/libghdl/vhdl/nodes.py b/pyGHDL/libghdl/vhdl/nodes.py index 8e50a35ff..8f4648790 100644 --- a/pyGHDL/libghdl/vhdl/nodes.py +++ b/pyGHDL/libghdl/vhdl/nodes.py @@ -1801,7 +1801,7 @@ class Iir_Predefined(IntEnum): @export @BindToLibGHDL("vhdl__nodes__get_kind") def Get_Kind(node: Iir) -> IirKind: - assert node != 0 + """Get node kind""" @export diff --git a/scripts/pnodespy.py b/scripts/pnodespy.py index b4209bc90..dabe94446 100755 --- a/scripts/pnodespy.py +++ b/scripts/pnodespy.py @@ -66,7 +66,7 @@ def do_iirs_subprg(): @export @BindToLibGHDL("{classname}__get_kind") def Get_Kind(node: Iir) -> IirKind: - assert node != 0 + \"\"\"Get node kind\"\"\" @export @BindToLibGHDL("{classname}__get_location") |