mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Implement EXPORT DEF to define and export symbols (#1422)
This commit is contained in:
@@ -3,7 +3,7 @@ error: anon-label-bad.asm(2):
|
||||
error: anon-label-bad.asm(6):
|
||||
Reference to anonymous label 2 before, when only 1 has been created so far
|
||||
error: anon-label-bad.asm(9):
|
||||
syntax error, unexpected anonymous label, expecting label or identifier or local identifier
|
||||
syntax error, unexpected anonymous label
|
||||
error: anon-label-bad.asm(10):
|
||||
syntax error, unexpected anonymous label, expecting label or identifier or local identifier
|
||||
error: anon-label-bad.asm(22):
|
||||
|
||||
18
test/asm/export.asm
Normal file
18
test/asm/export.asm
Normal file
@@ -0,0 +1,18 @@
|
||||
EXPORT undefined
|
||||
|
||||
DEF equ_sym EQU 1
|
||||
DEF var_sym = 2
|
||||
EXPORT equ_sym, var_sym
|
||||
|
||||
EXPORT DEF constant EQU 42
|
||||
EXPORT DEF variable = 1337
|
||||
EXPORT DEF byte RB
|
||||
EXPORT DEF word RW
|
||||
EXPORT DEF long RL
|
||||
EXPORT REDEF constant EQU 69
|
||||
EXPORT REDEF variable = 1234
|
||||
|
||||
; String constants can't be exported or imported.
|
||||
DEF equs_sym EQUS "hello"
|
||||
EXPORT equs_sym ; exports undefined symbol `hello` due to EQUS expansion
|
||||
EXPORT DEF string EQUS "goodbye" ; invalid syntax
|
||||
3
test/asm/export.err
Normal file
3
test/asm/export.err
Normal file
@@ -0,0 +1,3 @@
|
||||
error: export.asm(18):
|
||||
syntax error, unexpected EQUS
|
||||
error: Assembly aborted (1 error)!
|
||||
Reference in New Issue
Block a user