mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
@@ -1455,15 +1455,16 @@ static char const *readInterpolation(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define append_yylval_tzString(c) do { \
|
#define append_yylval_tzString(c) do { \
|
||||||
|
char v = (c); /* Evaluate c exactly once in case it has side effects. */ \
|
||||||
if (i < sizeof(yylval.tzString)) \
|
if (i < sizeof(yylval.tzString)) \
|
||||||
yylval.tzString[i++] = (c); \
|
yylval.tzString[i++] = v; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static size_t appendEscapedSubstring(char const *str, size_t i)
|
static size_t appendEscapedSubstring(char const *str, size_t i)
|
||||||
{
|
{
|
||||||
/* Copy one extra to flag overflow */
|
/* Copy one extra to flag overflow */
|
||||||
while (*str) {
|
while (*str) {
|
||||||
int c = *str++;
|
char c = *str++;
|
||||||
|
|
||||||
/* Escape characters that need escaping */
|
/* Escape characters that need escaping */
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|||||||
13
test/asm/long-string-constant.asm
Normal file
13
test/asm/long-string-constant.asm
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
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: !?"""
|
||||||
|
|
||||||
|
mac: MACRO
|
||||||
|
println "\1" ; x1
|
||||||
|
println "\1\1\1\1\1\1" ; x6
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
mac Hello! ; 6x6 = 36
|
||||||
|
mac This sentence spans forty-three characters. ; 43x6 = 258
|
||||||
4
test/asm/long-string-constant.err
Normal file
4
test/asm/long-string-constant.err
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
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
|
||||||
8
test/asm/long-string-constant.out
Normal file
8
test/asm/long-string-constant.out
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
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:
|
||||||
|
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
|
||||||
Reference in New Issue
Block a user