mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 18:52:07 +00:00
Fix REDEF EQUS behavior
Redefining an EQUS constant will now update its filename, like redefining a SET/= constant. Attempting to redefine as EQUS a non-EQUS constant will print an appropriate error message. This also standardizes on `sym` versus `symbol` as a variable name (which pairs with `symName`).
This commit is contained in:
@@ -958,7 +958,7 @@ is used to define numerical constant symbols.
|
||||
Unlike
|
||||
.Ic SET
|
||||
below, constants defined this way cannot be redefined.
|
||||
They can, for example, be used for things such as bit definitions of hardware registers.
|
||||
These constants can be used for unchanging values such as properties of the hardware.
|
||||
.Bd -literal -offset indent
|
||||
def SCREEN_WIDTH equ 160 ;\ In pixels
|
||||
def SCREEN_HEIGHT equ 144
|
||||
@@ -1075,7 +1075,7 @@ For example:
|
||||
DEF s EQUS "Hello, "
|
||||
REDEF s EQUS "{s}world!"
|
||||
; prints "Hello, world!"
|
||||
PRINTT "{s}\n"
|
||||
PRINTLN "{s}\n"
|
||||
.Ed
|
||||
.Pp
|
||||
.Sy Important note :
|
||||
|
||||
Reference in New Issue
Block a user