diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 191838f0e..539791f66 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,4 +1,4 @@ [bumpversion] -current_version = 1.8.5 +current_version = 1.8.6 files = version.py diff --git a/arch/zx48k/translator.py b/arch/zx48k/translator.py index 9e5a81ccc..be043866a 100644 --- a/arch/zx48k/translator.py +++ b/arch/zx48k/translator.py @@ -318,9 +318,9 @@ def visit_STRING(self, node): yield node.t def visit_END(self, node): - arg = (yield node.children[0]) + yield node.children[0] __DEBUG__('END') - self.emit('end', arg) + self.emit('end', node.children[0].t) def visit_ERROR(self, node): # Raises an error diff --git a/tests/functional/opt1_endtest.asm b/tests/functional/opt1_endtest.asm new file mode 100644 index 000000000..c0bafc840 --- /dev/null +++ b/tests/functional/opt1_endtest.asm @@ -0,0 +1,42 @@ + org 32768 +__START_PROGRAM: + di + push ix + push iy + exx + push hl + exx + ld hl, 0 + add hl, sp + ld (__CALL_BACK__), hl + ei + ld hl, (_N) + ld b, h + ld c, l +__END_PROGRAM: + di + ld hl, (__CALL_BACK__) + ld sp, hl + exx + pop hl + exx + pop iy + pop ix + ei + ret +__CALL_BACK__: + DEFW 0 + ld hl, 0 + ld b, h + ld c, l + jp __END_PROGRAM + +ZXBASIC_USER_DATA: +_N: + DEFB 39h + DEFB 30h + ; Defines DATA END --> HEAP size is 0 +ZXBASIC_USER_DATA_END EQU ZXBASIC_MEM_HEAP + ; Defines USER DATA Length in bytes +ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_END - ZXBASIC_USER_DATA + END diff --git a/tests/functional/opt1_endtest.bas b/tests/functional/opt1_endtest.bas new file mode 100644 index 000000000..21529525a --- /dev/null +++ b/tests/functional/opt1_endtest.bas @@ -0,0 +1,4 @@ + +DIM N as uinteger = 12345 +end N + diff --git a/tests/functional/opt3_endtest.asm b/tests/functional/opt3_endtest.asm new file mode 100644 index 000000000..5f8ee7ece --- /dev/null +++ b/tests/functional/opt3_endtest.asm @@ -0,0 +1,38 @@ + org 32768 +__START_PROGRAM: + di + push ix + push iy + exx + push hl + exx + ld hl, 0 + add hl, sp + ld (__CALL_BACK__), hl + ei + ld bc, (_N) +__END_PROGRAM: + di + ld hl, (__CALL_BACK__) + ld sp, hl + exx + pop hl + pop iy + pop ix + exx + ei + ret +__CALL_BACK__: + DEFW 0 + ld bc, 0 + jp __END_PROGRAM + +ZXBASIC_USER_DATA: +_N: + DEFB 39h + DEFB 30h + ; Defines DATA END --> HEAP size is 0 +ZXBASIC_USER_DATA_END EQU ZXBASIC_MEM_HEAP + ; Defines USER DATA Length in bytes +ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_END - ZXBASIC_USER_DATA + END diff --git a/tests/functional/opt3_endtest.bas b/tests/functional/opt3_endtest.bas new file mode 100644 index 000000000..21529525a --- /dev/null +++ b/tests/functional/opt3_endtest.bas @@ -0,0 +1,4 @@ + +DIM N as uinteger = 12345 +end N + diff --git a/version.py b/version.py index 181785c23..40c5bab5f 100755 --- a/version.py +++ b/version.py @@ -1 +1 @@ -VERSION = '1.8.5' +VERSION = '1.8.6'