aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/dom/InterfaceItem.py
diff options
context:
space:
mode:
authorUnai Martinez-Corral <38422348+umarcor@users.noreply.github.com>2021-06-23 16:07:10 +0100
committerGitHub <noreply@github.com>2021-06-23 16:07:10 +0100
commitc6283d9a9b40c3e9afeba912fcb13aa9d56b9c52 (patch)
treee1706cb19a2439e3d94657e54c688a36c703f048 /pyGHDL/dom/InterfaceItem.py
parent983236ac3dfd0c455a0ac910a9a468ea2c81e5d9 (diff)
parent240b4fdd90a9f3ca04e8e168bffdc92bea2ca3f3 (diff)
downloadghdl-c6283d9a9b40c3e9afeba912fcb13aa9d56b9c52.tar.gz
ghdl-c6283d9a9b40c3e9afeba912fcb13aa9d56b9c52.tar.bz2
ghdl-c6283d9a9b40c3e9afeba912fcb13aa9d56b9c52.zip
DOM: Functions and types (#1804)
Diffstat (limited to 'pyGHDL/dom/InterfaceItem.py')
-rw-r--r--pyGHDL/dom/InterfaceItem.py32
1 files changed, 11 insertions, 21 deletions
diff --git a/pyGHDL/dom/InterfaceItem.py b/pyGHDL/dom/InterfaceItem.py
index eac92c8a6..f720e69b4 100644
--- a/pyGHDL/dom/InterfaceItem.py
+++ b/pyGHDL/dom/InterfaceItem.py
@@ -46,7 +46,7 @@ from pyVHDLModel.VHDLModel import (
from pyGHDL.libghdl.vhdl import nodes
from pyGHDL.libghdl.vhdl.nodes import Null_Iir
from pyGHDL.dom._Utils import GetNameOfNode, GetModeOfNode
-from pyGHDL.dom._Translate import GetSubtypeIndicationFromNode, GetExpressionFromNode
+from pyGHDL.dom._Translate import GetSubTypeIndicationFromNode, GetExpressionFromNode
__all__ = []
@@ -58,13 +58,11 @@ class GenericConstantInterfaceItem(VHDLModel_GenericConstantInterfaceItem):
def parse(cls, generic):
name = GetNameOfNode(generic)
mode = GetModeOfNode(generic)
- subTypeIndication = GetSubtypeIndicationFromNode(generic, "generic", name)
+ subTypeIndication = GetSubTypeIndicationFromNode(generic, "generic", name)
default = nodes.Get_Default_Value(generic)
value = GetExpressionFromNode(default) if default else None
- g = cls(name, mode, subTypeIndication, value)
-
- return g
+ return cls(name, mode, subTypeIndication, value)
def __init__(
self,
@@ -84,16 +82,14 @@ class PortSignalInterfaceItem(VHDLModel_PortSignalInterfaceItem):
def parse(cls, port):
name = GetNameOfNode(port)
mode = GetModeOfNode(port)
- subTypeIndication = GetSubtypeIndicationFromNode(port, "port", name)
+ subTypeIndication = GetSubTypeIndicationFromNode(port, "port", name)
defaultValue = nodes.Get_Default_Value(port)
value = (
GetExpressionFromNode(defaultValue) if defaultValue != Null_Iir else None
)
- p = cls(name, mode, subTypeIndication, value)
-
- return p
+ return cls(name, mode, subTypeIndication, value)
def __init__(
self,
@@ -113,16 +109,14 @@ class ParameterConstantInterfaceItem(VHDLModel_ParameterConstantInterfaceItem):
def parse(cls, parameter):
name = GetNameOfNode(parameter)
mode = GetModeOfNode(parameter)
- subTypeIndication = GetSubtypeIndicationFromNode(parameter, "parameter", name)
+ subTypeIndication = GetSubTypeIndicationFromNode(parameter, "parameter", name)
defaultValue = nodes.Get_Default_Value(parameter)
value = (
GetExpressionFromNode(defaultValue) if defaultValue != Null_Iir else None
)
- param = cls(name, mode, subTypeIndication, value)
-
- return param
+ return cls(name, mode, subTypeIndication, value)
def __init__(
self,
@@ -142,16 +136,14 @@ class ParameterVariableInterfaceItem(VHDLModel_ParameterVariableInterfaceItem):
def parse(cls, parameter):
name = GetNameOfNode(parameter)
mode = GetModeOfNode(parameter)
- subTypeIndication = GetSubtypeIndicationFromNode(parameter, "parameter", name)
+ subTypeIndication = GetSubTypeIndicationFromNode(parameter, "parameter", name)
defaultValue = nodes.Get_Default_Value(parameter)
value = (
GetExpressionFromNode(defaultValue) if defaultValue != Null_Iir else None
)
- param = cls(name, mode, subTypeIndication, value)
-
- return param
+ return cls(name, mode, subTypeIndication, value)
def __init__(
self,
@@ -171,16 +163,14 @@ class ParameterSignalInterfaceItem(VHDLModel_ParameterSignalInterfaceItem):
def parse(cls, parameter):
name = GetNameOfNode(parameter)
mode = GetModeOfNode(parameter)
- subTypeIndication = GetSubtypeIndicationFromNode(parameter, "parameter", name)
+ subTypeIndication = GetSubTypeIndicationFromNode(parameter, "parameter", name)
defaultValue = nodes.Get_Default_Value(parameter)
value = (
GetExpressionFromNode(defaultValue) if defaultValue != Null_Iir else None
)
- param = cls(name, mode, subTypeIndication, value)
-
- return param
+ return cls(name, mode, subTypeIndication, value)
def __init__(
self,