aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2022-11-30 23:29:04 +0100
committerPatrick Lehmann <Patrick.Lehmann@plc2.de>2022-12-23 23:42:29 +0100
commit4280385c83d349906e799cf0f32e6e7a4a491124 (patch)
tree0d27c980a8d5b2ab752572a9730ee7888ff16171
parent2161dcbb0077057e1da026368ef44e056e637d43 (diff)
downloadghdl-4280385c83d349906e799cf0f32e6e7a4a491124.tar.gz
ghdl-4280385c83d349906e799cf0f32e6e7a4a491124.tar.bz2
ghdl-4280385c83d349906e799cf0f32e6e7a4a491124.zip
Collect multiline comments with linebreaks.
-rw-r--r--pyGHDL/dom/_Utils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pyGHDL/dom/_Utils.py b/pyGHDL/dom/_Utils.py
index b61168418..10053db6e 100644
--- a/pyGHDL/dom/_Utils.py
+++ b/pyGHDL/dom/_Utils.py
@@ -91,12 +91,13 @@ def GetNameOfNode(node: Iir) -> str:
def GetDocumentationOfNode(node: Iir) -> str:
file = files_map.Location_To_File(nodes.Get_Location(node))
idx = file_comments.Find_First_Comment(file, node)
- documentation = ""
+ documentation = []
while idx != file_comments.No_Comment_Index:
- documentation += file_comments.Get_Comment(file, idx)
+ documentation.append(file_comments.Get_Comment(file, idx))
idx = file_comments.Get_Next_Comment(file, idx)
- return documentation
+ return "\n".join(documentation)
+
@export
def GetModeOfNode(node: Iir) -> Mode: