Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statement: Add more types #267

Merged
merged 1 commit into from
Dec 13, 2024
Merged
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
18 changes: 9 additions & 9 deletions ailment/statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class Jump(Statement):
"target_idx",
)

def __init__(self, idx, target, target_idx: int | None = None, **kwargs):
def __init__(self, idx: int | None, target: Expression, target_idx: int | None = None, **kwargs):
super().__init__(idx, **kwargs)

self.target = target
Expand Down Expand Up @@ -329,10 +329,10 @@ class ConditionalJump(Statement):

def __init__(
self,
idx,
condition,
true_target,
false_target,
idx: int | None,
condition: Expression,
true_target: Expression | None,
false_target: Expression | None,
true_target_idx: int | None = None,
false_target_idx: int | None = None,
**kwargs,
Expand Down Expand Up @@ -477,8 +477,8 @@ class Call(Expression, Statement):

def __init__(
self,
idx,
target,
idx: int | None,
target: Expression | str,
calling_convention: SimCC | None = None,
prototype=None,
args: Sequence[Expression] | None = None,
Expand Down Expand Up @@ -651,7 +651,7 @@ class Return(Statement):

__slots__ = ("ret_exprs",)

def __init__(self, idx, ret_exprs, **kwargs):
def __init__(self, idx: int | None, ret_exprs, **kwargs):
super().__init__(idx, **kwargs)
self.ret_exprs = ret_exprs if isinstance(ret_exprs, list) else list(ret_exprs)

Expand Down Expand Up @@ -762,7 +762,7 @@ class Label(Statement):
"block_idx",
)

def __init__(self, idx, name: str, ins_addr: int, block_idx: int | None = None, **kwargs):
def __init__(self, idx: int | None, name: str, ins_addr: int, block_idx: int | None = None, **kwargs):
super().__init__(idx, **kwargs)
self.name = name
self.ins_addr = ins_addr
Expand Down
Loading