aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2022-06-24 23:19:00 +0200
committerPatrick Lehmann <Patrick.Lehmann@plc2.de>2022-12-24 11:47:51 +0100
commit829587b67d5be107bd44cfcb0c24e3bdddf0fc21 (patch)
treeebc533da721a68d33520c4d0a99e630d4f3b185e
parent960e44185ac356cca07d9d2eb6386e0286e31270 (diff)
downloadghdl-829587b67d5be107bd44cfcb0c24e3bdddf0fc21.tar.gz
ghdl-829587b67d5be107bd44cfcb0c24e3bdddf0fc21.tar.bz2
ghdl-829587b67d5be107bd44cfcb0c24e3bdddf0fc21.zip
Tiny fixes.
(cherry picked from commit 2cb36a37f5efa1185ba4c61ea65b49aa6e9345a0)
-rw-r--r--pyGHDL/dom/_Utils.py4
-rw-r--r--pyGHDL/libghdl/libraries.py13
-rw-r--r--pyGHDL/libghdl/vhdl/std_package.py18
3 files changed, 25 insertions, 10 deletions
diff --git a/pyGHDL/dom/_Utils.py b/pyGHDL/dom/_Utils.py
index 3b647013b..d8cd9a15c 100644
--- a/pyGHDL/dom/_Utils.py
+++ b/pyGHDL/dom/_Utils.py
@@ -109,5 +109,5 @@ def GetModeOfNode(node: Iir) -> Mode:
try:
return __MODE_TRANSLATION[nodes.Get_Mode(node)]
- except KeyError:
- raise LibGHDLException("Unknown mode.")
+ except KeyError as ex:
+ raise DOMException(f"Unknown mode '{ex.args[0]}'.") from ex
diff --git a/pyGHDL/libghdl/libraries.py b/pyGHDL/libghdl/libraries.py
index fe09fa920..f31d3ec5f 100644
--- a/pyGHDL/libghdl/libraries.py
+++ b/pyGHDL/libghdl/libraries.py
@@ -50,15 +50,18 @@ __all__ = ["Library_Location", "Work_Library"]
Library_Location: LocationType = c_int32.in_dll(libghdl, "libraries__library_location")
"""
-A location for library declarations (such as library WORK). Use ``.value`` to
-access this variable inside libghdl.
+A location for library declarations (such as library WORK).
+
+Use the property ``.value`` to access the variable's value.
"""
Work_Library: Iir_Library_Declaration = c_int32.in_dll(libghdl, "libraries__work_library")
"""
-Library declaration for the work library. Note: the identifier of the work_library
-is ``work_library_name``, which may be different from 'WORK'. Use ``.value`` to
-access this variable inside libghdl.
+Library declaration for the work library.
+
+.. note:: The identifier of the work_library is ``work_library_name``, which may be different from 'WORK'.
+
+Use the property ``.value`` to access the variable's value.
"""
diff --git a/pyGHDL/libghdl/vhdl/std_package.py b/pyGHDL/libghdl/vhdl/std_package.py
index f2c46385a..d9035779c 100644
--- a/pyGHDL/libghdl/vhdl/std_package.py
+++ b/pyGHDL/libghdl/vhdl/std_package.py
@@ -46,12 +46,24 @@ __all__ = ["Std_Location", "Standard_Package", "Character_Type_Definition"]
Std_Location: LocationType = c_int32.in_dll(libghdl, "vhdl__std_package__std_location")
-"""Virtual location for the ``std.standard`` package. Use ``.value`` to access this variable inside libghdl."""
+"""
+Virtual location for the ``std.standard`` package.
+
+Use the property ``.value`` to access the variable's value.
+"""
Standard_Package: Iir_Package_Declaration = c_int32.in_dll(libghdl, "vhdl__std_package__standard_package")
-"""Virtual package ``std.package``. Use ``.value`` to access this variable inside libghdl."""
+"""
+Virtual package ``std.package``.
+
+Use the property ``.value`` to access the variable's value.
+"""
Character_Type_Definition: Iir_Enumeration_Type_Definition = c_int32.in_dll(
libghdl, "vhdl__std_package__character_type_definition"
)
-"""Predefined character. Use ``.value`` to access this variable inside libghdl."""
+"""
+Predefined character.
+
+Use the property ``.value`` to access the variable's value.
+"""