diff --git a/pymint/mintcompiler.py b/pymint/mintcompiler.py index 9a5e204..4e026d9 100644 --- a/pymint/mintcompiler.py +++ b/pymint/mintcompiler.py @@ -251,7 +251,9 @@ def exitChannelStat(self, ctx: mintParser.ChannelStatContext): source_target = ctx.uftarget()[0] # type: ignore _sn = getattr(source_target, "target_name", None) source_id = ( - _sn.text if _sn is not None else (source_target.ID() or source_target.ID_BIG()).getText() + _sn.text + if _sn is not None + else (source_target.ID() or source_target.ID_BIG()).getText() ) if self.current_device.device.component_exists(source_id) is False: raise Exception( @@ -270,7 +272,9 @@ def exitChannelStat(self, ctx: mintParser.ChannelStatContext): sink_target = ctx.uftarget()[1] # type: ignore _sn2 = getattr(sink_target, "target_name", None) sink_id = ( - _sn2.text if _sn2 is not None else (sink_target.ID() or sink_target.ID_BIG()).getText() + _sn2.text + if _sn2 is not None + else (sink_target.ID() or sink_target.ID_BIG()).getText() ) if self.current_device.device.component_exists(sink_id) is False: raise Exception( @@ -309,7 +313,9 @@ def exitNetStat(self, ctx: mintParser.NetStatContext): source_target = ctx.uftarget() _sn = getattr(source_target, "target_name", None) source_id = ( - _sn.text if _sn is not None else (source_target.ID() or source_target.ID_BIG()).getText() + _sn.text + if _sn is not None + else (source_target.ID() or source_target.ID_BIG()).getText() ) if source_target.INT(): # type: ignore source_port = source_target.INT().getText() # type: ignore @@ -323,7 +329,9 @@ def exitNetStat(self, ctx: mintParser.NetStatContext): for sink_target in ctx.uftargets().uftarget(): # type: ignore _sn2 = getattr(sink_target, "target_name", None) sink_id = ( - _sn2.text if _sn2 is not None else (sink_target.ID() or sink_target.ID_BIG()).getText() + _sn2.text + if _sn2 is not None + else (sink_target.ID() or sink_target.ID_BIG()).getText() ) if sink_target.INT(): sink_port = sink_target.INT().getText()