aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-06-19 06:55:30 +0200
committerTristan Gingold <tgingold@free.fr>2021-06-19 06:55:30 +0200
commit87d5a055051838d9e80624f547e0a11b877daec2 (patch)
treea681875de3ded1c8c37d3043942bb15aded3d84d /pyGHDL
parenta219d4ce25c38a308a8db518c8562f0348452bd7 (diff)
downloadghdl-87d5a055051838d9e80624f547e0a11b877daec2.tar.gz
ghdl-87d5a055051838d9e80624f547e0a11b877daec2.tar.bz2
ghdl-87d5a055051838d9e80624f547e0a11b877daec2.zip
pyGHDL: use LocationType instead of Location_Type
Diffstat (limited to 'pyGHDL')
-rw-r--r--pyGHDL/libghdl/_types.py3
-rw-r--r--pyGHDL/libghdl/files_map.py16
-rw-r--r--pyGHDL/libghdl/libraries.py4
-rw-r--r--pyGHDL/libghdl/vhdl/std_package.py4
4 files changed, 13 insertions, 14 deletions
diff --git a/pyGHDL/libghdl/_types.py b/pyGHDL/libghdl/_types.py
index 936060f57..ff8743e60 100644
--- a/pyGHDL/libghdl/_types.py
+++ b/pyGHDL/libghdl/_types.py
@@ -77,8 +77,7 @@ TimeStampId = TypeVar("TimeStampId", bound=c_uint32)
SourceFileEntry = TypeVar("SourceFileEntry", bound=c_uint32)
SourcePtr = TypeVar("SourcePtr", bound=c_int32)
-Location_Type = TypeVar("Location_Type", bound=c_uint32)
-LocationType = Location_Type
+LocationType = TypeVar("LocationType", bound=c_uint32)
Iir = TypeVar("Iir", bound=int)
IirKind = TypeVar("IirKind", bound=c_int32)
diff --git a/pyGHDL/libghdl/files_map.py b/pyGHDL/libghdl/files_map.py
index ceda483c5..1726225bc 100644
--- a/pyGHDL/libghdl/files_map.py
+++ b/pyGHDL/libghdl/files_map.py
@@ -35,7 +35,7 @@
from pydecor import export
from pyGHDL.libghdl._decorator import BindToLibGHDL
-from pyGHDL.libghdl._types import NameId, SourceFileEntry, Location_Type
+from pyGHDL.libghdl._types import NameId, SourceFileEntry, LocationType
__all__ = [
"EOT",
@@ -52,7 +52,7 @@ No_Location = 0
@export
@BindToLibGHDL("files_map__location_to_file")
-def Location_To_File(Location: Location_Type) -> SourceFileEntry:
+def Location_To_File(Location: LocationType) -> SourceFileEntry:
"""
Convert :obj:`Location` to a source file.
@@ -63,7 +63,7 @@ def Location_To_File(Location: Location_Type) -> SourceFileEntry:
@export
@BindToLibGHDL("files_map__location_file_to_pos")
-def Location_File_To_Pos(Location: Location_Type, File: SourceFileEntry) -> int:
+def Location_File_To_Pos(Location: LocationType, File: SourceFileEntry) -> int:
"""
Convert :obj:`Location` and :obj:`File` to a position (offset) into the source file.
@@ -75,7 +75,7 @@ def Location_File_To_Pos(Location: Location_Type, File: SourceFileEntry) -> int:
@export
@BindToLibGHDL("files_map__location_file_to_line")
-def Location_File_To_Line(Location: Location_Type, File: SourceFileEntry) -> int:
+def Location_File_To_Line(Location: LocationType, File: SourceFileEntry) -> int:
"""
Convert :obj:`Location` and :obj:`File` to a line number.
@@ -88,7 +88,7 @@ def Location_File_To_Line(Location: Location_Type, File: SourceFileEntry) -> int
@export
@BindToLibGHDL("files_map__location_file_line_to_offset")
def Location_File_Line_To_Offset(
- Location: Location_Type, File: SourceFileEntry, Line: int
+ Location: LocationType, File: SourceFileEntry, Line: int
) -> int:
"""
Get the offset in :obj:`Line` of :obj:`Location`.
@@ -103,7 +103,7 @@ def Location_File_Line_To_Offset(
@export
@BindToLibGHDL("files_map__location_file_line_to_col")
def Location_File_Line_To_Col(
- Location: Location_Type, File: SourceFileEntry, Line: int
+ Location: LocationType, File: SourceFileEntry, Line: int
) -> int:
"""
Get logical column (with HT expanded) from :obj:`Location`, :obj:`File` and
@@ -118,7 +118,7 @@ def Location_File_Line_To_Col(
@export
@BindToLibGHDL("files_map__file_to_location")
-def File_To_Location(File: SourceFileEntry) -> Location_Type:
+def File_To_Location(File: SourceFileEntry) -> LocationType:
"""Convert a :obj:`File` into a location.
:param File: Source file
@@ -128,7 +128,7 @@ def File_To_Location(File: SourceFileEntry) -> Location_Type:
@export
@BindToLibGHDL("files_map__file_pos_to_location")
-def File_Pos_To_Location(File: SourceFileEntry, Pos: int) -> Location_Type:
+def File_Pos_To_Location(File: SourceFileEntry, Pos: int) -> LocationType:
"""
Convert a :obj:`File` and an offset :obj:`Pos` in the file into a location.
diff --git a/pyGHDL/libghdl/libraries.py b/pyGHDL/libghdl/libraries.py
index 963f390d9..7dd417054 100644
--- a/pyGHDL/libghdl/libraries.py
+++ b/pyGHDL/libghdl/libraries.py
@@ -42,13 +42,13 @@ from pyGHDL.libghdl._types import (
Iir_Library_Declaration,
Iir_Design_Unit,
Iir_Design_File,
- Location_Type,
+ LocationType,
)
from pyGHDL.libghdl._decorator import BindToLibGHDL
__all__ = ["Library_Location", "Work_Library"]
-Library_Location: Location_Type = c_int32.in_dll(libghdl, "libraries__library_location")
+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.
diff --git a/pyGHDL/libghdl/vhdl/std_package.py b/pyGHDL/libghdl/vhdl/std_package.py
index 600aaea83..6ea6462fd 100644
--- a/pyGHDL/libghdl/vhdl/std_package.py
+++ b/pyGHDL/libghdl/vhdl/std_package.py
@@ -36,7 +36,7 @@ from ctypes import c_int32
from pyGHDL.libghdl import libghdl
from pyGHDL.libghdl._types import (
- Location_Type,
+ LocationType,
Iir_Package_Declaration,
Iir_Enumeration_Type_Definition,
)
@@ -45,7 +45,7 @@ from pyGHDL.libghdl._types import (
__all__ = ["Std_Location", "Standard_Package", "Character_Type_Definition"]
-Std_Location: Location_Type = c_int32.in_dll(libghdl, "vhdl__std_package__std_location")
+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."""
Standard_Package: Iir_Package_Declaration = c_int32.in_dll(