Skip to content

Commit bbe6a4b

Browse files
committed
fix: add missing parse rule in assembler
1 parent 8039b68 commit bbe6a4b

8 files changed

Lines changed: 353 additions & 297 deletions

File tree

poetry.lock

Lines changed: 336 additions & 288 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232

3333
SHELVE_PATH = os.path.join(constants.ZXBASIC_ROOT, "parsetab", "tabs.dbm")
34-
SHELVE = shelve.open(SHELVE_PATH)
34+
SHELVE = shelve.open(SHELVE_PATH, protocol=5, flag="c")
3535

3636
T = TypeVar("T")
3737

@@ -178,7 +178,7 @@ def eval_to_num(expr: str) -> int | float | None:
178178
except (NameError, SyntaxError, ValueError):
179179
return None
180180

181-
if isinstance(result, (int, float)):
181+
if isinstance(result, int | float):
182182
return result
183183

184184
return None

src/parsetab/tabs.dbm.bak

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
'zxbpp', (0, 71563)
2-
'asmparse', (71680, 233956)
3-
'zxnext_asmparse', (305664, 259034)
4-
'zxbparser', (564736, 641214)
2+
'asmparse', (71680, 234798)
3+
'zxnext_asmparse', (306688, 259879)
4+
'zxbparser', (566784, 641214)

src/parsetab/tabs.dbm.dat

2 KB
Binary file not shown.

src/parsetab/tabs.dbm.dir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
'zxbpp', (0, 71563)
2-
'asmparse', (71680, 233956)
3-
'zxnext_asmparse', (305664, 259034)
4-
'zxbparser', (564736, 641214)
2+
'asmparse', (71680, 234798)
3+
'zxnext_asmparse', (306688, 259879)
4+
'zxbparser', (566784, 641214)

src/zxbasm/asmparse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,9 @@ def p_expr_div_expr(p):
925925

926926

927927
def p_expr_lprp(p):
928-
"""pexpr : LP expr RP"""
928+
"""pexpr : LP expr RP
929+
| LP pexpr RP
930+
"""
929931
p[0] = p[2]
930932

931933

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ld hl, (_Fuente.__DATA__ + 0) - (256)
2+
ld hl, ((_Fuente.__DATA__ + 0)) - (256)
3+
ld hl, ((_Fuente.__DATA__ + 0) - (256))
4+
5+
_Fuente.__DATA__:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
! �! �* �

0 commit comments

Comments
 (0)