diff options
Diffstat (limited to 'pyGHDL/dom/InterfaceItem.py')
-rw-r--r-- | pyGHDL/dom/InterfaceItem.py | 32 |
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, |