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
3 changes: 2 additions & 1 deletion src/api/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from src.api import config, errmsg, global_
from src.api.constants import CLASS, SCOPE
from src.symbols import sym as symbols
from src.symbols.symbol_ import Symbol
from src.symbols.type_ import Type

__all__ = [
Expand Down Expand Up @@ -318,7 +319,7 @@ def is_number(*p):
"""Returns True if ALL the arguments are AST nodes
containing NUMBER or numeric CONSTANTS
"""
return all(i.token in ("NUMBER", "CONST") and Type.is_numeric(i.type_) for i in p)
return all(isinstance(i, Symbol) and i.token in ("NUMBER", "CONST") and Type.is_numeric(i.type_) for i in p)


def is_static_str(*p):
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/arch/zx48k/do_crash.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DIM A AS UBYTE
DO LOOP WHILE A = ""
5 changes: 5 additions & 0 deletions tests/functional/cmdline/test_errmsg.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,8 @@ ND.Controls.bas:4: error: Invalid argument 'dirData'
ND.Controls.bas:2: warning: [W150] Variable 'dirData' is never used
>>> process_file('arch/zx48k/bad_fname_err4.bas', ['-S', '-q'])
ND.Controls.bas:2: error: sub 'Controls_LABEL' declared but not implemented

# DO LOOP type errors
>>> process_file('arch/zx48k/do_crash.bas', ['-S', '-q'])
do_crash.bas:2: error: Cannot convert string to a value. Use VAL() function
do_crash.bas:2: warning: [W130] Empty loop