Skip to content

Commit 2572f5a

Browse files
committed
fix: error and warning directives in zxbpp
When preprocessing asm files, the zxbpp error and warning directives were not working. Fixed.
1 parent 39e7c0d commit 2572f5a

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/zxbpp/zxbasmpplex.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
"line": "LINE",
7575
"require": "REQUIRE",
7676
"pragma": "PRAGMA",
77+
"error": "ERROR",
78+
"warning": "WARNING",
7779
}
7880

7981
# List of token names.

tests/functional/error_macro.asm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#warning "this is a warning"
2+
#error "this is an error"
3+
nop
4+

tests/functional/test_errmsg.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,7 @@ ND.Controls.bas:4: error: Invalid argument 'dirData'
252252
ND.Controls.bas:2: warning: [W150] Variable 'dirData' is never used
253253
>>> process_file('zx48k/bad_fname_err4.bas', ['-S', '-q'])
254254
ND.Controls.bas:2: error: sub 'Controls_LABEL' declared but not implemented
255+
256+
>>> process_file('error_macro.asm')
257+
error_macro.asm:1: warning: this is a warning
258+
error_macro.asm:2: error: this is an error

0 commit comments

Comments
 (0)