diff --git a/pymint/mintcompiler.py b/pymint/mintcompiler.py index 8d58765..7fc5426 100644 --- a/pymint/mintcompiler.py +++ b/pymint/mintcompiler.py @@ -257,7 +257,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( @@ -276,7 +278,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( @@ -315,7 +319,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 @@ -329,7 +335,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()