diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-02-14 18:29:28 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-02-15 18:26:12 +0100 |
commit | 20225660889132452360ff6e8403fbc88d60e677 (patch) | |
tree | d6ddfc3c3a9a6c064453d360034302fa1161f8d7 /src | |
parent | 8669c8f94463850aa7cdcc2b8aa1e51c1a003bc8 (diff) | |
download | ghdl-20225660889132452360ff6e8403fbc88d60e677.tar.gz ghdl-20225660889132452360ff6e8403fbc88d60e677.tar.bz2 ghdl-20225660889132452360ff6e8403fbc88d60e677.zip |
python binding: add leftest_location.
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/python/libghdl/thinutils.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vhdl/python/libghdl/thinutils.py b/src/vhdl/python/libghdl/thinutils.py index be2957512..1e8ee417d 100644 --- a/src/vhdl/python/libghdl/thinutils.py +++ b/src/vhdl/python/libghdl/thinutils.py @@ -50,6 +50,17 @@ def attr_image(a): return _attr_image[a] +def leftest_location(n): + while True: + if n == Null_Iir: + return No_Location + k = iirs.Get_Kind(n) + if k == iirs.Iir_Kind.Array_Subtype_Definition: + n = iirs.Get_Subtype_Type_Mark(n) + else: + return iirs.Get_Location(n) + + def fields_iter(n): """Iterate on fields of node n""" if n == Null_Iir: |