mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Only define @ and _NARG when they have values (#1073)
Fixes #1069 Co-authored-by: Eldred Habert <eldredhabert0@gmail.com>
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
if "{@}"
|
||||
endc
|
||||
@@ -1,5 +0,0 @@
|
||||
error: if@-no-sect.asm(1):
|
||||
PC has no value outside a section
|
||||
warning: if@-no-sect.asm(1): [-Wnumeric-string]
|
||||
Treating 2-character string as a number
|
||||
error: Assembly aborted (1 error)!
|
||||
@@ -1 +0,0 @@
|
||||
PRINTLN "{_NARG}"
|
||||
@@ -1,3 +0,0 @@
|
||||
error: narg-nosect.asm(1):
|
||||
_NARG does not make sense outside of a macro
|
||||
error: Assembly aborted (1 error)!
|
||||
@@ -1 +0,0 @@
|
||||
$0
|
||||
@@ -1,5 +0,0 @@
|
||||
IF DEF(@)
|
||||
PRINTLN "defined"
|
||||
ELSE
|
||||
PRINTLN "not defined"
|
||||
ENDC
|
||||
@@ -1 +0,0 @@
|
||||
defined
|
||||
21
test/asm/undefined-builtins.asm
Normal file
21
test/asm/undefined-builtins.asm
Normal file
@@ -0,0 +1,21 @@
|
||||
; not inside a section
|
||||
assert !DEF(@)
|
||||
println @
|
||||
println "{@}?"
|
||||
|
||||
; not inside a macro
|
||||
assert !DEF(_NARG)
|
||||
println _NARG
|
||||
println "{_NARG}?"
|
||||
|
||||
SECTION "s", ROM0[$42]
|
||||
assert DEF(@)
|
||||
println @
|
||||
println "{@}!"
|
||||
|
||||
MACRO m
|
||||
assert DEF(_NARG)
|
||||
println _NARG
|
||||
println "{_NARG}!"
|
||||
ENDM
|
||||
m 1, 2, 3
|
||||
9
test/asm/undefined-builtins.err
Normal file
9
test/asm/undefined-builtins.err
Normal file
@@ -0,0 +1,9 @@
|
||||
error: undefined-builtins.asm(3):
|
||||
PC has no value outside a section
|
||||
error: undefined-builtins.asm(4):
|
||||
Interpolated symbol "@" does not exist
|
||||
error: undefined-builtins.asm(8):
|
||||
_NARG does not make sense outside of a macro
|
||||
error: undefined-builtins.asm(9):
|
||||
Interpolated symbol "_NARG" does not exist
|
||||
error: Assembly aborted (4 errors)!
|
||||
8
test/asm/undefined-builtins.out
Normal file
8
test/asm/undefined-builtins.out
Normal file
@@ -0,0 +1,8 @@
|
||||
$0
|
||||
?
|
||||
$0
|
||||
?
|
||||
$42
|
||||
$42!
|
||||
$3
|
||||
$3!
|
||||
Reference in New Issue
Block a user