aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/dom
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-22 11:59:09 +0200
committerPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-22 12:28:25 +0200
commit0a69901be945dfb6c5372e657332d5e5ddfa10c7 (patch)
tree976beef99129705fa8d0e592dfba4fad61b80135 /pyGHDL/dom
parentef92aeca1b940e26b8fb6d562dcc74b06bb450f8 (diff)
downloadghdl-0a69901be945dfb6c5372e657332d5e5ddfa10c7.tar.gz
ghdl-0a69901be945dfb6c5372e657332d5e5ddfa10c7.tar.bz2
ghdl-0a69901be945dfb6c5372e657332d5e5ddfa10c7.zip
Fixed issues reported by Codacy.
Diffstat (limited to 'pyGHDL/dom')
-rw-r--r--pyGHDL/dom/Expression.py7
-rw-r--r--pyGHDL/dom/Literal.py7
-rw-r--r--pyGHDL/dom/NonStandard.py3
-rw-r--r--pyGHDL/dom/_Translate.py14
4 files changed, 13 insertions, 18 deletions
diff --git a/pyGHDL/dom/Expression.py b/pyGHDL/dom/Expression.py
index 2802351d4..b129e1ce5 100644
--- a/pyGHDL/dom/Expression.py
+++ b/pyGHDL/dom/Expression.py
@@ -168,13 +168,6 @@ class FunctionCall(VHDLModel_FunctionCall):
@export
-class QualifiedExpression(VHDLModel_QualifiedExpression):
- def __init__(self, operand: Expression):
- super().__init__()
- self._operand = operand
-
-
-@export
class AdditionExpression(VHDLModel_AdditionExpression, _ParseBinaryExpression):
def __init__(self, left: Expression, right: Expression):
super().__init__()
diff --git a/pyGHDL/dom/Literal.py b/pyGHDL/dom/Literal.py
index 44c002955..209712ba3 100644
--- a/pyGHDL/dom/Literal.py
+++ b/pyGHDL/dom/Literal.py
@@ -30,10 +30,6 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ============================================================================
-from pyGHDL.dom._Utils import GetIirKindOfNode, GetNameOfNode
-from pyGHDL.libghdl import name_table
-
-from pyGHDL.libghdl.vhdl import nodes
from pydecor import export
from pyVHDLModel.VHDLModel import (
@@ -44,6 +40,9 @@ from pyVHDLModel.VHDLModel import (
CharacterLiteral as VHDLModel_CharacterLiteral,
StringLiteral as VHDLModel_StringLiteral,
)
+from pyGHDL.libghdl import name_table
+from pyGHDL.libghdl.vhdl import nodes
+from pyGHDL.dom._Utils import GetNameOfNode
__all__ = []
diff --git a/pyGHDL/dom/NonStandard.py b/pyGHDL/dom/NonStandard.py
index c3fd358b5..9010e392b 100644
--- a/pyGHDL/dom/NonStandard.py
+++ b/pyGHDL/dom/NonStandard.py
@@ -80,7 +80,8 @@ class Design(VHDLModel_Design):
self.__ghdl_init()
def __ghdl_init(self):
- """Initialization: set options and then load libraries"""
+ """Initialization: set options and then load libraries."""
+
# Initialize libghdl
libghdl_finalize()
libghdl_initialize()
diff --git a/pyGHDL/dom/_Translate.py b/pyGHDL/dom/_Translate.py
index 4e5baa9cf..2b2a44e60 100644
--- a/pyGHDL/dom/_Translate.py
+++ b/pyGHDL/dom/_Translate.py
@@ -331,15 +331,17 @@ def GetParameterFromChainedNodes(nodeChain: Iir):
for parameter in utils.chain_iter(nodeChain):
kind = GetIirKindOfNode(parameter)
if kind == nodes.Iir_Kind.Interface_Constant_Declaration:
- pass
+ from pyGHDL.dom.InterfaceItem import ParameterConstantInterfaceItem
+
+ result.append(ParameterConstantInterfaceItem.parse(parameter))
elif kind == nodes.Iir_Kind.Interface_Variable_Declaration:
- pass
- elif kind == nodes.Iir_Kind.Interface_Signal_Declaration:
- from pyGHDL.dom.InterfaceItem import PortSignalInterfaceItem
+ from pyGHDL.dom.InterfaceItem import ParameterVariableInterfaceItem
- portSignal = ParameterSignalInterfaceItem.parse(parameter)
+ result.append(ParameterVariableInterfaceItem.parse(parameter))
+ elif kind == nodes.Iir_Kind.Interface_Signal_Declaration:
+ from pyGHDL.dom.InterfaceItem import ParameterSignalInterfaceItem
- result.append(portSignal)
+ result.append(ParameterSignalInterfaceItem.parse(parameter))
else:
position = GetPositionOfNode(parameter)
raise DOMException(