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
11 changes: 8 additions & 3 deletions src/zxbc/zxbparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,17 @@ def make_unary(lineno, operator, operand, func=None, type_=None):
return sym.UNARY.make_node(lineno, operator, operand, func, type_)


def make_builtin(lineno, fname, operands, func=None, type_=None):
def make_builtin(lineno: int, fname: str, operands: Symbol | tuple | list | None, func=None, type_=None):
"""Wrapper: returns a Builtin function node.
Can be a Symbol, tuple or list of Symbols
If operand is an iterable, they will be expanded.
"""
if operands is None:
operands = []
assert isinstance(operands, Symbol) or isinstance(operands, tuple) or isinstance(operands, list)
assert isinstance(operands, Symbol | tuple | list)
# TODO: In the future, builtin functions will be implemented in an external stdlib, like POINT or ATTR
__DEBUG__(f'Creating BUILTIN "{fname}"', 1)
if not isinstance(operands, (list, tuple, set)):
if not isinstance(operands, (list, tuple)):
operands = [operands]

return sym.BUILTIN.make_node(lineno, fname, func, type_, *operands)
Expand Down Expand Up @@ -1739,6 +1739,11 @@ def p_data(p):
p[0] = None
return

if gl.FUNCTION_LEVEL:
errmsg.error(p.lineno(1), "DATA not allowed within Functions nor Subs")
p[0] = None
return

for d in p[2].children:
value = d.value
if is_static(value):
Expand Down
47 changes: 0 additions & 47 deletions tests/functional/arch/zx48k/sub_data.asm

This file was deleted.