mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Do not limit strings to 255 characters
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
; Strings used to be truncated to 255 characters with a warning.
|
||||
|
||||
def num equ 42
|
||||
def fix equ 123.0
|
||||
def str equs "hello"
|
||||
|
||||
@@ -1,35 +1,5 @@
|
||||
error: format-truncation.asm(5):
|
||||
Formatted numeric value too long
|
||||
error: format-truncation.asm(6):
|
||||
Formatted numeric value too long
|
||||
error: format-truncation.asm(7):
|
||||
Fractional width 260 too long, limiting to 255
|
||||
error: format-truncation.asm(7):
|
||||
Formatted numeric value too long
|
||||
error: format-truncation.asm(8):
|
||||
Formatted string value too long
|
||||
error: format-truncation.asm(9):
|
||||
Formatted string value too long
|
||||
error: format-truncation.asm(11):
|
||||
Formatted numeric value too long
|
||||
warning: format-truncation.asm(11): [-Wlong-string]
|
||||
String constant too long
|
||||
error: format-truncation.asm(12):
|
||||
Formatted numeric value too long
|
||||
warning: format-truncation.asm(12): [-Wlong-string]
|
||||
String constant too long
|
||||
error: format-truncation.asm(13):
|
||||
Fractional width 260 too long, limiting to 255
|
||||
error: format-truncation.asm(13):
|
||||
Formatted numeric value too long
|
||||
warning: format-truncation.asm(13): [-Wlong-string]
|
||||
String constant too long
|
||||
error: format-truncation.asm(14):
|
||||
Formatted string value too long
|
||||
warning: format-truncation.asm(14): [-Wlong-string]
|
||||
String constant too long
|
||||
error: format-truncation.asm(15):
|
||||
Formatted string value too long
|
||||
warning: format-truncation.asm(15): [-Wlong-string]
|
||||
String constant too long
|
||||
error: Assembly aborted (12 errors)!
|
||||
Fractional width 260 too long, limiting to 255
|
||||
error: Assembly aborted (2 errors)!
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
$00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
$2a
|
||||
000000000000000000000123.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
|
||||
hello
|
||||
<$0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
<$2a
|
||||
<000000000000000000000123.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
<
|
||||
<hello
|
||||
$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a
|
||||
$2a
|
||||
000000000000000000000123.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
hello
|
||||
hello
|
||||
<$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a>
|
||||
<$2a >
|
||||
<000000000000000000000123.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>
|
||||
< hello>
|
||||
<hello >
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
error: interpolation-overflow.asm(4):
|
||||
Fractional width 99999999 too long, limiting to 255
|
||||
error: interpolation-overflow.asm(4):
|
||||
Formatted numeric value too long
|
||||
warning: interpolation-overflow.asm(4): [-Wlarge-constant]
|
||||
Precision of fixed-point constant is too large
|
||||
while expanding symbol "0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
while expanding symbol "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
error: interpolation-overflow.asm(4):
|
||||
Macro argument '\1' not defined
|
||||
error: interpolation-overflow.asm(4):
|
||||
syntax error, unexpected number
|
||||
error: Assembly aborted (4 errors)!
|
||||
error: Assembly aborted (3 errors)!
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
DEF n EQU 42
|
||||
; the format spec is truncated to "000...009", omitting the "x", so this prints "000000042" not "00000002a"
|
||||
; the format spec used to be truncated, but not any more
|
||||
PRINTLN "{000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009x:n}"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
SECTION "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit", ROM0[0]
|
||||
SECTION "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", ROM0[0]
|
||||
println "This is section ", SECTION(@)
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
warning: long-section-name.asm(1): [-Wlong-string]
|
||||
String constant too long
|
||||
@@ -1 +1 @@
|
||||
This is section Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor i
|
||||
This is section Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
|
||||
println """This paragraph has exactly 257--that's two hundred and
|
||||
fifty-seven--characters altogether. That's just enough for its last
|
||||
two characters to be truncated by rgbasm's lexer, since it can't
|
||||
handle more than 255-character strings. The final two won't print: !?"""
|
||||
println """Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium dol-
|
||||
oremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore verita-
|
||||
tis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam vol-
|
||||
uptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur
|
||||
magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam
|
||||
est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed
|
||||
quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam
|
||||
quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam
|
||||
corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis
|
||||
autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil mole-
|
||||
stiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"""
|
||||
|
||||
MACRO mac
|
||||
println "\1" ; x1
|
||||
println "\1\1\1\1\1\1" ; x6
|
||||
println "\1\1\1\1\1\1\1" ; x7
|
||||
ENDM
|
||||
|
||||
mac Hello! ; 6x6 = 36
|
||||
mac This sentence spans forty-three characters. ; 43x6 = 258
|
||||
mac Hello! ; 6x7 = 42
|
||||
mac This sentence spans forty-three characters. ; 43x7 = 301
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
warning: long-string-constant.asm(5): [-Wlong-string]
|
||||
String constant too long
|
||||
warning: long-string-constant.asm(13) -> long-string-constant.asm::mac(9): [-Wlong-string]
|
||||
String constant too long
|
||||
@@ -1,8 +1,15 @@
|
||||
This paragraph has exactly 257--that's two hundred and
|
||||
fifty-seven--characters altogether. That's just enough for its last
|
||||
two characters to be truncated by rgbasm's lexer, since it can't
|
||||
handle more than 255-character strings. The final two won't print:
|
||||
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium dol-
|
||||
oremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore verita-
|
||||
tis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam vol-
|
||||
uptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur
|
||||
magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam
|
||||
est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed
|
||||
quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam
|
||||
quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam
|
||||
corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis
|
||||
autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil mole-
|
||||
stiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
|
||||
Hello!
|
||||
Hello!Hello!Hello!Hello!Hello!Hello!
|
||||
Hello!Hello!Hello!Hello!Hello!Hello!Hello!
|
||||
This sentence spans forty-three characters.
|
||||
This sentence spans forty-three characters.This sentence spans forty-three characters.This sentence spans forty-three characters.This sentence spans forty-three characters.This sentence spans forty-three characters.This sentence spans forty-three characte
|
||||
This sentence spans forty-three characters.This sentence spans forty-three characters.This sentence spans forty-three characters.This sentence spans forty-three characters.This sentence spans forty-three characters.This sentence spans forty-three characters.This sentence spans forty-three characters.
|
||||
|
||||
@@ -15,7 +15,7 @@ ENDM
|
||||
mac 1, 2 + /* another ;
|
||||
; comment */ 2, 3
|
||||
|
||||
mac a b ; truncated
|
||||
mac a b ; long
|
||||
|
||||
mac
|
||||
mac ,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
warning: macro-arguments.asm(18): [-Wlong-string]
|
||||
Macro argument too long
|
||||
warning: macro-arguments.asm(21): [-Wempty-macro-arg]
|
||||
Empty macro argument
|
||||
warning: macro-arguments.asm(23): [-Wempty-macro-arg]
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
\2: <2 + 2>
|
||||
\3: <3>
|
||||
|
||||
'mac a':
|
||||
\1: <a>
|
||||
'mac a b':
|
||||
\1: <a b>
|
||||
|
||||
'mac ':
|
||||
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
warning: strrpl.asm(4): [-Wempty-strrpl]
|
||||
STRRPL: Cannot replace an empty string
|
||||
warning: strrpl.asm(6): [-Wlong-string]
|
||||
STRRPL: String too long, got truncated
|
||||
|
||||
@@ -3,4 +3,4 @@ hahohahol
|
||||
hello
|
||||
world
|
||||
|
||||
[bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbb
|
||||
[bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb][bbbbbbbb]
|
||||
|
||||
Reference in New Issue
Block a user