Skip to content

Commit bd761ad

Browse files
authored
Merge pull request #456 from boriel/bugfix/regression_with_is_const
Bugfix/regression with is const
2 parents 45a1381 + e8ec2b8 commit bd761ad

3 files changed

Lines changed: 65 additions & 1 deletion

File tree

src/api/check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def is_number(*p):
268268
containing NUMBER or numeric CONSTANTS
269269
"""
270270
try:
271-
return all(i.token == 'NUMBER' or is_const(i) for i in p)
271+
return all(i.token == 'NUMBER' or (i.token == 'ID' and i.class_ == CLASS.const) for i in p)
272272
except Exception:
273273
pass
274274

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
org 32768
2+
__START_PROGRAM:
3+
di
4+
push ix
5+
push iy
6+
exx
7+
push hl
8+
exx
9+
ld hl, 0
10+
add hl, sp
11+
ld (__CALL_BACK__), hl
12+
ei
13+
jp __MAIN_PROGRAM__
14+
ZXBASIC_USER_DATA:
15+
; Defines USER DATA Length in bytes
16+
ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_END - ZXBASIC_USER_DATA
17+
.__LABEL__.ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_LEN
18+
.__LABEL__.ZXBASIC_USER_DATA EQU ZXBASIC_USER_DATA
19+
_dw1:
20+
DEFB 00, 00
21+
ZXBASIC_USER_DATA_END:
22+
__MAIN_PROGRAM__:
23+
ld hl, 8192
24+
ld (_dw1), hl
25+
jp __LABEL0
26+
__LABEL3:
27+
__LABEL4:
28+
ld hl, (_dw1)
29+
ld de, 32
30+
add hl, de
31+
ld (_dw1), hl
32+
__LABEL0:
33+
ld hl, 8255
34+
ld de, (_dw1)
35+
or a
36+
sbc hl, de
37+
jp nc, __LABEL3
38+
__LABEL2:
39+
ld hl, 0
40+
ld b, h
41+
ld c, l
42+
__END_PROGRAM:
43+
di
44+
ld hl, (__CALL_BACK__)
45+
ld sp, hl
46+
exx
47+
pop hl
48+
exx
49+
pop iy
50+
pop ix
51+
ei
52+
ret
53+
__CALL_BACK__:
54+
DEFW 0
55+
;; --- end of user code ---
56+
END
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
const tablaSprites as Uinteger=8192
3+
4+
5+
DIM dw1 as Uinteger
6+
for dw1=tablaSprites to tablaSprites+63 step 32
7+
next
8+

0 commit comments

Comments
 (0)