Skip to content

Commit ac9ed91

Browse files
authored
Statement: Add more types (#267)
1 parent 6e4d648 commit ac9ed91

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ailment/statement.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class Jump(Statement):
264264
"target_idx",
265265
)
266266

267-
def __init__(self, idx, target, target_idx: int | None = None, **kwargs):
267+
def __init__(self, idx: int | None, target: Expression, target_idx: int | None = None, **kwargs):
268268
super().__init__(idx, **kwargs)
269269

270270
self.target = target
@@ -329,10 +329,10 @@ class ConditionalJump(Statement):
329329

330330
def __init__(
331331
self,
332-
idx,
333-
condition,
334-
true_target,
335-
false_target,
332+
idx: int | None,
333+
condition: Expression,
334+
true_target: Expression | None,
335+
false_target: Expression | None,
336336
true_target_idx: int | None = None,
337337
false_target_idx: int | None = None,
338338
**kwargs,
@@ -477,8 +477,8 @@ class Call(Expression, Statement):
477477

478478
def __init__(
479479
self,
480-
idx,
481-
target,
480+
idx: int | None,
481+
target: Expression | str,
482482
calling_convention: SimCC | None = None,
483483
prototype=None,
484484
args: Sequence[Expression] | None = None,
@@ -651,7 +651,7 @@ class Return(Statement):
651651

652652
__slots__ = ("ret_exprs",)
653653

654-
def __init__(self, idx, ret_exprs, **kwargs):
654+
def __init__(self, idx: int | None, ret_exprs, **kwargs):
655655
super().__init__(idx, **kwargs)
656656
self.ret_exprs = ret_exprs if isinstance(ret_exprs, list) else list(ret_exprs)
657657

@@ -762,7 +762,7 @@ class Label(Statement):
762762
"block_idx",
763763
)
764764

765-
def __init__(self, idx, name: str, ins_addr: int, block_idx: int | None = None, **kwargs):
765+
def __init__(self, idx: int | None, name: str, ins_addr: int, block_idx: int | None = None, **kwargs):
766766
super().__init__(idx, **kwargs)
767767
self.name = name
768768
self.ins_addr = ins_addr

0 commit comments

Comments
 (0)