Skip to content

Commit e9d6637

Browse files
authored
Merge pull request #587 from boriel/bugfix/asm_db_multiple
fix: fixes DB expr syn rule in ASM
2 parents 286b577 + 867cb4d commit e9d6637

6 files changed

Lines changed: 16 additions & 11 deletions

File tree

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, 76970)
2-
'asmparse', (77312, 268610)
3-
'zxnext_asmparse', (346112, 298625)
4-
'zxbparser', (645120, 708977)
2+
'asmparse', (77312, 269087)
3+
'zxnext_asmparse', (346624, 299111)
4+
'zxbparser', (646144, 708977)

src/parsetab/tabs.dbm.dat

1 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, 76970)
2-
'asmparse', (77312, 268610)
3-
'zxnext_asmparse', (346112, 298625)
4-
'zxbparser', (645120, 708977)
2+
'asmparse', (77312, 269087)
3+
'zxnext_asmparse', (346624, 299111)
4+
'zxbparser', (646144, 708977)

src/zxbasm/asmparse.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ def p_idlist_id(p):
211211

212212

213213
def p_DEFB(p): # Define bytes
214-
"""asm : DEFB expr_list
215-
| DEFB number_list
216-
"""
214+
"""asm : DEFB expr_list"""
217215
p[0] = Asm(p.lineno(1), "DEFB", p[2])
218216

219217

@@ -239,6 +237,13 @@ def p_expr_list_from_string(p):
239237
p[0] = tuple(Expr.makenode(Container(ord(x), p.lineno(1))) for x in p[1])
240238

241239

240+
def p_expr_list_from_num(p):
241+
"""expr_list : expr
242+
| pexpr
243+
"""
244+
p[0] = (p[1],)
245+
246+
242247
def p_expr_list_plus_expr(p):
243248
"""expr_list : expr_list COMMA expr
244249
| expr_list COMMA pexpr

tests/functional/db_multi.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22
DB "Hello", 32, "Worl", 'D' + 32
3-
3+
DB 32, "Hello"

tests/functional/db_multi.bin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Hello World
1+
Hello World Hello

0 commit comments

Comments
 (0)