Handle more numeric literal syntax errors in linker scripts

This commit is contained in:
Rangi
2026-06-09 18:44:03 -04:00
parent 0b91bf654b
commit fc7d9ad573
5 changed files with 69 additions and 38 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
error: No hexadecimal digits found after '$'
error: Invalid integer constant, no digits after '$'
at script-lone-dollar.link(1)
Linking failed with 1 error
+1 -1
View File
@@ -1,3 +1,3 @@
error: No binary digits found after '%'
error: Invalid integer constant, no digits after '%'
at script-lone-percent.link(1)
Linking failed with 1 error
+7 -5
View File
@@ -1,9 +1,11 @@
ROM0
org 4_2
org %10_10_10
org &52_
org $2A_
org 0b101_010
org 0o5_2
org &52_ ; trailing '_'
org $2A_ ; trailing '_'
org 0b101__010 ; '_' after another '_'
org 0o__5_2 ; '_' after another '_'
org 0x2_A
org 41 ; Error!
org 41 ; different value
org %_ ; no digits
org 0x__ ; no digits
+23 -1
View File
@@ -1,3 +1,25 @@
error: Invalid integer constant, trailing '_'
at script-num-fmt.link(4)
error: Invalid integer constant, trailing '_'
at script-num-fmt.link(5)
error: Invalid integer constant, '_' after another '_'
at script-num-fmt.link(6)
error: Invalid integer constant, '_' after another '_'
at script-num-fmt.link(7)
error: Cannot decrease the current address (from $002a to $0029)
at script-num-fmt.link(9)
Linking failed with 1 error
error: Invalid integer constant, no digits after '%'
at script-num-fmt.link(10)
error: Invalid integer constant, trailing '_'
at script-num-fmt.link(10)
error: Cannot decrease the current address (from $002a to $0000)
at script-num-fmt.link(10)
error: Invalid integer constant, '_' after another '_'
at script-num-fmt.link(11)
error: Invalid integer constant, no digits after "0x"
at script-num-fmt.link(11)
error: Invalid integer constant, trailing '_'
at script-num-fmt.link(11)
error: Cannot decrease the current address (from $002a to $0000)
at script-num-fmt.link(11)
Linking failed with 12 errors