aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/dom/Subprogram.py
diff options
context:
space:
mode:
authortgingold <tgingold@users.noreply.github.com>2022-12-24 08:56:55 +0100
committerGitHub <noreply@github.com>2022-12-24 08:56:55 +0100
commit26bb3c572eaffafafd8de8ef09b8acc34f91656f (patch)
tree2d70696f4f8bb78f9a4fda7a6d596775fdf080cc /pyGHDL/dom/Subprogram.py
parent8845f761ed2299e595afd5eee2444fed7fb79639 (diff)
parent5d9897770cb16494c6379cce85ed5935532c0cd1 (diff)
downloadghdl-26bb3c572eaffafafd8de8ef09b8acc34f91656f.tar.gz
ghdl-26bb3c572eaffafafd8de8ef09b8acc34f91656f.tar.bz2
ghdl-26bb3c572eaffafafd8de8ef09b8acc34f91656f.zip
Merge pull request #2265 from Paebbels/paebbels/DOM-with-documentation
pyGHDL.dom with Documentation
Diffstat (limited to 'pyGHDL/dom/Subprogram.py')
-rw-r--r--pyGHDL/dom/Subprogram.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/pyGHDL/dom/Subprogram.py b/pyGHDL/dom/Subprogram.py
index 2e9c0116f..46ce92707 100644
--- a/pyGHDL/dom/Subprogram.py
+++ b/pyGHDL/dom/Subprogram.py
@@ -13,7 +13,7 @@
#
# License:
# ============================================================================
-# Copyright (C) 2019-2021 Tristan Gingold
+# Copyright (C) 2019-2022 Tristan Gingold
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@ from pyVHDLModel.SyntaxModel import (
from pyGHDL.libghdl._types import Iir
from pyGHDL.libghdl.vhdl import nodes
from pyGHDL.dom import DOMMixin
-from pyGHDL.dom._Utils import GetNameOfNode
+from pyGHDL.dom._Utils import GetNameOfNode, GetDocumentationOfNode
from pyGHDL.dom.Symbol import SimpleSubtypeSymbol
@@ -57,8 +57,9 @@ class Function(VHDLModel_Function, DOMMixin):
returnType: SubtypeOrSymbol,
genericItems: List[GenericInterfaceItem] = None,
parameterItems: List[ParameterInterfaceItem] = None,
+ documentation: str = None,
):
- super().__init__(functionName)
+ super().__init__(functionName, documentation)
DOMMixin.__init__(self, node)
# TODO: move to model
@@ -74,6 +75,7 @@ class Function(VHDLModel_Function, DOMMixin):
)
functionName = GetNameOfNode(functionNode)
+ documentation = GetDocumentationOfNode(functionNode)
generics = GetGenericsFromChainedNodes(nodes.Get_Generic_Chain(functionNode))
parameters = GetParameterFromChainedNodes(nodes.Get_Interface_Declaration_Chain(functionNode))
@@ -82,7 +84,7 @@ class Function(VHDLModel_Function, DOMMixin):
returnTypeName = GetNameOfNode(returnType)
returnTypeSymbol = SimpleSubtypeSymbol(returnType, returnTypeName)
- return cls(functionNode, functionName, returnTypeSymbol, generics, parameters)
+ return cls(functionNode, functionName, returnTypeSymbol, generics, parameters, documentation)
@export
@@ -93,8 +95,9 @@ class Procedure(VHDLModel_Procedure, DOMMixin):
procedureName: str,
genericItems: List[GenericInterfaceItem] = None,
parameterItems: List[ParameterInterfaceItem] = None,
+ documentation: str = None,
):
- super().__init__(procedureName)
+ super().__init__(procedureName, documentation)
DOMMixin.__init__(self, node)
# TODO: move to model
@@ -109,8 +112,9 @@ class Procedure(VHDLModel_Procedure, DOMMixin):
)
procedureName = GetNameOfNode(procedureNode)
+ documentation = GetDocumentationOfNode(procedureNode)
generics = GetGenericsFromChainedNodes(nodes.Get_Generic_Chain(procedureNode))
parameters = GetParameterFromChainedNodes(nodes.Get_Interface_Declaration_Chain(procedureNode))
- return cls(procedureNode, procedureName, generics, parameters)
+ return cls(procedureNode, procedureName, generics, parameters, documentation)