Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions pymint/mintcompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down
Loading