mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Support more syntax in linkerscripts (#1752)
* No need to use `locale`s * Implement octal numbers, `_` digit separators, and `0x/0b/0o` prefixes in linkerscripts * Refactor some functions out of `yylex` * Support `\0` in linkerscripts
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
ROM0
|
||||
org 42
|
||||
org %101010
|
||||
org $2A
|
||||
org 4_2
|
||||
org %10_10_10
|
||||
org &52_
|
||||
org $2A_
|
||||
org 0b101_010
|
||||
org 0o5_2
|
||||
org 0x2_A
|
||||
org 41 ; Error!
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
error: script-num-fmt.link(5): Cannot decrease the current address (from $002a to $0029)
|
||||
error: script-num-fmt.link(9): Cannot decrease the current address (from $002a to $0029)
|
||||
Linking failed with 1 error
|
||||
|
||||
8
test/link/script-okay.link
Normal file
8
test/link/script-okay.link
Normal file
@@ -0,0 +1,8 @@
|
||||
ROM0
|
||||
"ROM0"
|
||||
"\\\"\'\n\r\t\0"
|
||||
ROMX 1
|
||||
"ROM1"
|
||||
ROMX 2
|
||||
"ROM2 1K"
|
||||
"ROM2 1"
|
||||
0
test/link/script-okay.out
Normal file
0
test/link/script-okay.out
Normal file
@@ -7,3 +7,4 @@ SECTION "ROM2 1K", ROMX,BANK[2]
|
||||
ds $1000
|
||||
SECTION "ROM2 1", ROMX,BANK[2]
|
||||
ds 1
|
||||
SECTION "\\\"\'\n\r\t\0", ROM0
|
||||
|
||||
Reference in New Issue
Block a user