Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/api/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from src.api.config import OPTIONS
from src.api.constants import CLASS, CONVENTION, SCOPE, TYPE
from src.api.errmsg import warning_not_used
from src.ast import Ast, NodeVisitor
from src.ast_ import Ast, NodeVisitor
from src.symbols import sym as symbols
from src.symbols.id_ import ref

Expand Down
2 changes: 1 addition & 1 deletion src/arch/z80/visitor/translator_inst_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from src.arch.interface.quad import Quad
from src.arch.z80.backend import Backend
from src.arch.z80.backend.common import BOOL_t, F16_t, F_t, I8_t, I16_t, I32_t, STR_t, U8_t, U16_t, U32_t
from src.ast import NodeVisitor
from src.ast_ import NodeVisitor
from src.symbols import sym


Expand Down
2 changes: 1 addition & 1 deletion src/arch/z80/visitor/translator_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from src.arch.z80 import backend
from src.arch.z80.backend.runtime import LABEL_REQUIRED_MODULES, RUNTIME_LABELS
from src.arch.z80.backend.runtime import Labels as RuntimeLabel
from src.ast.tree import ChildrenList
from src.ast_.tree import ChildrenList
from src.symbols import sym as symbols
from src.symbols.symbol_ import Symbol
from src.symbols.type_ import Type
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/symbols/symbol_.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from collections import Counter

import src.api.global_
from src.ast import Ast, Tree
from src.ast_ import Ast, Tree


class Symbol(Ast):
Expand Down
4 changes: 2 additions & 2 deletions src/zxbasm/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# --------------------------------------------------------------------

from src.api.errmsg import error
from src.ast import Ast
from src.ast.exceptions import NotAnAstError
from src.ast_ import Ast
from src.ast_.exceptions import NotAnAstError
from src.zxbasm.label import Label


Expand Down
15 changes: 11 additions & 4 deletions src/zxbasm/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,12 @@ def add_instruction(self, instr: Asm):
for byte in instr.bytes():
self.__set_byte(byte, instr.lineno)

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

for filename in self._tmp_pending_labels:
Expand Down Expand Up @@ -209,7 +211,12 @@ def dump(self):
return org, OUTPUT

def declare_label(
self, label: str, lineno: int, value: int = None, local: bool = False, namespace: str | None = None
self,
label: str,
lineno: int,
value: int | None = None,
local: bool = False,
namespace: str | None = None,
) -> None:
"""Sets a label with the given value or with the current address (org)
if no value is passed.
Expand Down
Loading