Skip to content

Commit 39dad24

Browse files
authored
Merge pull request #415 from boriel/bugfix/token_error_in_asm
Bugfix/token error in asm
2 parents d6e495b + e67dc89 commit 39dad24

4 files changed

Lines changed: 46 additions & 2 deletions

File tree

src/libzxbpp/zxbasmpplex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def t_INITIAL_CHAR(self, t):
106106
return t
107107

108108
def t_INITIAL_TOKEN(self, t):
109-
r"[][%'`,.:$()*/<>~&|+^-]"
109+
r"[][}{%'`,.:$()*/<>~&|+^-]"
110110
return t
111111

112112
def t_prepro_define_defargs_defargsopt_defexpr_pragma_NEWLINE(self, t):

src/libzxbpp/zxbpplex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def t_asm_CHAR(self, t):
122122
return t
123123

124124
def t_asm_TOKEN(self, t):
125-
r"[]['`.:$*/+<>|&~%^-]"
125+
r"[][}{'`.:$*/+<>|&~%^-]"
126126
return t
127127

128128
def t_INITIAL_CONTINUE(self, t):

tests/functional/asm_tokens.asm

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
ZXBASIC_USER_DATA_END:
20+
__MAIN_PROGRAM__:
21+
#line 0
22+
ld a, {{macro_value}}
23+
#line 1
24+
ld hl, 0
25+
ld b, h
26+
ld c, l
27+
__END_PROGRAM:
28+
di
29+
ld hl, (__CALL_BACK__)
30+
ld sp, hl
31+
exx
32+
pop hl
33+
exx
34+
pop iy
35+
pop ix
36+
ei
37+
ret
38+
__CALL_BACK__:
39+
DEFW 0
40+
END

tests/functional/asm_tokens.bas

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
asm
2+
ld a, {{macro_value}}
3+
end asm
4+

0 commit comments

Comments
 (0)