aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2022-11-29 00:13:15 +0100
committertgingold <tgingold@users.noreply.github.com>2022-11-30 05:12:08 +0100
commitfccc8028d933837d703d8673f4897e44c4e17ef3 (patch)
treef33d2018c9860474dbd9255bf503397bca40805f /pyGHDL
parent5e56e21db717ddcdb61d1dca26a87efb0c0a0380 (diff)
downloadghdl-fccc8028d933837d703d8673f4897e44c4e17ef3.tar.gz
ghdl-fccc8028d933837d703d8673f4897e44c4e17ef3.tar.bz2
ghdl-fccc8028d933837d703d8673f4897e44c4e17ef3.zip
Applied formatting rules from black.
Diffstat (limited to 'pyGHDL')
-rw-r--r--pyGHDL/libghdl/file_comments.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/pyGHDL/libghdl/file_comments.py b/pyGHDL/libghdl/file_comments.py
index a1ca11384..507694a64 100644
--- a/pyGHDL/libghdl/file_comments.py
+++ b/pyGHDL/libghdl/file_comments.py
@@ -45,12 +45,13 @@ import pyGHDL.libghdl.files_map as files_map
__all__ = [
"Comment_Index",
"No_Comment_Index",
- ]
+]
Comment_Index = TypeVar("Comment_Index", bound=c_uint32)
No_Comment_Index = 0
+
@export
@BindToLibGHDL("file_comments__find_first_comment")
def Find_First_Comment(File: SourceFileEntry, N: c_uint32) -> Comment_Index:
@@ -62,6 +63,7 @@ def Find_First_Comment(File: SourceFileEntry, N: c_uint32) -> Comment_Index:
"""
return 0
+
@export
@BindToLibGHDL("file_comments__get_comment_start")
def Get_Comment_Start(File: SourceFileEntry, Idx: Comment_Index) -> SourcePtr:
@@ -69,6 +71,7 @@ def Get_Comment_Start(File: SourceFileEntry, Idx: Comment_Index) -> SourcePtr:
Get the start of comment
"""
+
@export
@BindToLibGHDL("file_comments__get_comment_last")
def Get_Comment_Last(File: SourceFileEntry, Idx: Comment_Index) -> SourcePtr:
@@ -76,14 +79,16 @@ def Get_Comment_Last(File: SourceFileEntry, Idx: Comment_Index) -> SourcePtr:
Get the end of comment
"""
+
def Get_Comment(File: SourceFileEntry, Idx: Comment_Index) -> str:
"""
Get a comment
"""
buf = files_map.Get_File_Buffer(File)
- s = Get_Comment_Start(File, Idx);
- l = Get_Comment_Last(File, Idx);
- return buf[s:l+1].decode("iso-8859-1")
+ s = Get_Comment_Start(File, Idx)
+ l = Get_Comment_Last(File, Idx)
+ return buf[s : l + 1].decode("iso-8859-1")
+
@export
@BindToLibGHDL("file_comments__get_next_comment")
@@ -91,4 +96,3 @@ def Get_Next_Comment(File: SourceFileEntry, Idx: Comment_Index) -> Comment_Index
"""
Get the next comment
"""
-