Skip to content

Commit

Permalink
chore: Remove some FIXMEs and TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
N3rdL0rd committed Dec 26, 2024
1 parent c721ec0 commit 4d9313e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions crashlink/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from io import BytesIO
from typing import Any, BinaryIO, Dict, List, Literal, Optional, Tuple, TypeVar

T = TypeVar("T", bound="VarInt") # HACK: easier than reimplementing deserialise for each subclass
T = TypeVar("T", bound="VarInt") # easier than reimplementing deserialise for each subclass

from .errors import (FailedSerialisation, InvalidOpCode, MalformedBytecode,
NoMagic)
Expand All @@ -30,7 +30,6 @@
USE_TQDM = False


# TODO: rewrite all ABCs like this to use the PEP 3119 `abc` module
class Serialisable(ABC):
"""
Base class for all serialisable objects.
Expand Down Expand Up @@ -218,13 +217,14 @@ def serialise(self) -> bytes:
)


class ResolvableVarInt(VarInt):
class ResolvableVarInt(VarInt, ABC):
"""
Base class for resolvable VarInts. Call `resolve` to get a direct reference to the object it points to.
"""

@abstractmethod
def resolve(self, code: "Bytecode") -> Any:
raise NotImplementedError("resolve is not implemented for this class.")
pass


class fIndex(ResolvableVarInt):
Expand Down
2 changes: 1 addition & 1 deletion crashlink/disasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def from_asm(asm: str) -> List[Opcode]:
opargs = opcodes[op]
for name, type in opargs.items():
new_value = Opcode.TYPE_MAP[type]()
new_value.value = literal_eval(args.pop(0)) # FIXME: unsafe?
new_value.value = literal_eval(args.pop(0))
new_opcode.definition[name] = new_value
ops.append(new_opcode)
return ops

0 comments on commit 4d9313e

Please sign in to comment.