Skip to content

Commit 97bcd29

Browse files
committed
Improve typing
1 parent 6b39cdf commit 97bcd29

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎src/zxbasm/memory.py‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,12 @@ def add_instruction(self, instr: Asm):
160160
for byte in instr.bytes():
161161
self.__set_byte(byte, instr.lineno)
162162

163-
def dump(self):
164-
"""Returns a tuple containing code ORG (origin address), and a list of bytes (OUTPUT)"""
163+
def dump(self) -> tuple[int, list[int]]:
164+
"""Returns a tuple containing code ORG (origin address), and a list of bytes (OUTPUT)
165+
self.orgs[ ] contains ADDRESS -> Mnemonic, where Mnemonic.arg[x].eval() is the value of the argument x.
166+
"""
165167
org = min(self.memory_bytes.keys()) # Org is the lowest one
166-
OUTPUT = []
168+
OUTPUT: list[int] = []
167169
align = []
168170

169171
for filename in self._tmp_pending_labels:
@@ -209,7 +211,12 @@ def dump(self):
209211
return org, OUTPUT
210212

211213
def declare_label(
212-
self, label: str, lineno: int, value: int = None, local: bool = False, namespace: str | None = None
214+
self,
215+
label: str,
216+
lineno: int,
217+
value: int | None = None,
218+
local: bool = False,
219+
namespace: str | None = None,
213220
) -> None:
214221
"""Sets a label with the given value or with the current address (org)
215222
if no value is passed.

0 commit comments

Comments
 (0)