Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/arch/z80/backend/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,6 @@ def _inline(ins):

i = 0
while i < len(tmp):
if not tmp[i]: # discard empty lines
tmp.pop(i)
continue

if not tmp[i] or tmp[i][0] == ";": # a comment
i += 1
continue
Expand Down
2 changes: 1 addition & 1 deletion src/arch/z80/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ def visit_ITALIC(self, node):
# -----------------------------------------------------------------------------------------------------
def visit_ASM(self, node):
EOL = "\n"
self.ic_inline(f'#line {node.lineno + 1} "{node.filename}"')
self.ic_inline(f'#line {node.lineno} "{node.filename}"')
self.ic_inline(node.asm)
self.ic_inline(f'#line {node.lineno + len(node.asm.split(EOL))} "{node.filename}"')

Expand Down
2 changes: 2 additions & 0 deletions tests/functional/test_errmsg.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ line_number_after_macro.bas:11: error: Syntax Error. Unexpected token '+' <PLUS>
>>> process_file('zx48k/tap_asm_error_line.bas', ['-S', '-q'])
tap_asm_error_line.bas:3: error: Syntax error. Unexpected token '10' [INTEGER]
tap_asm_error_line.bas:7: error: Syntax error. Unexpected token '10' [INTEGER]
>>> process_file('zx48k/tap_errline.bas')
tap_errline.bas:10: error: Syntax error. Unexpected token 'HL' [HL]

# Test error file names
>>> process_file('zx48k/bad_fname_err0.bas', ['-S', '-q'])
Expand Down
15 changes: 15 additions & 0 deletions tests/functional/zx48k/tap_errline.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

asm
push hl
push de
push af

ld hl,16384
ld de,16385
ld a,(hl)
ex hl,de

pop af
pop de
pop hl
end asm