Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions dncil/cil/body/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def __init__(self, flags: int):
self.InitLocals: bool = bool(flags & CorILMethod.InitLocals)
self.CompressedIL: bool = bool(flags & CorILMethod.CompressedIL)

def __str__(self):
def _to_print(v):
def __str__(self) -> str:
def _to_print(v: bool) -> str:
return "true" if v else "false"

return (
Expand All @@ -39,7 +39,7 @@ def _to_print(v):
+ f"CompressedIL : {_to_print(self.CompressedIL)}\n"
)

def __repr__(self):
def __repr__(self) -> str:
return str(self)

def is_tiny(self) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions dncil/cil/instruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class Instruction:
"""store managed instruction"""

def __init__(self):
def __init__(self) -> None:
self.offset: int
self.opcode: OpCode
self.opcode_bytes: bytes
Expand All @@ -45,7 +45,7 @@ def __int__(self) -> int:
return self.offset

@property
def mnemonic(self):
def mnemonic(self) -> str:
"""get instruction opcode mnemonic"""
return self.opcode.name

Expand Down
2 changes: 1 addition & 1 deletion dncil/cil/opcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(
op_code_type: OpCodeType,
stack_push: StackBehaviour,
stack_pop: StackBehaviour,
):
) -> None:
self.name: str = name
self.value: OpCodeValue = value
self.operand_type: OperandType = operand_type
Expand Down