mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-06 20:25:34 +00:00
Newlines in multi-line strings update the line number
This affects error and warning messages, and dbgPrint
This commit is contained in:
1 parent
fc2bf3d11d
commit
96bce05be2
3 files changed
+10
-3
No files matched your search
+6
-3
@@ -1457,9 +1457,12 @@ static void readString(void)
|
||||
// We'll be staying in the string, so we can safely consume the char
|
||||
shiftChars(1);
|
||||
|
||||
// Handle CRLF (in multiline strings only, already handled above otherwise)
|
||||
if (c == '\r' && peek(0) == '\n') {
|
||||
shiftChars(1);
|
||||
// Handle '\r' or '\n' (in multiline strings only, already handled above otherwise)
|
||||
if (c == '\r' || c == '\n') {
|
||||
/* Handle CRLF before nextLine() since shiftChars updates colNo */
|
||||
if (c == '\r' && peek(0) == '\n')
|
||||
shiftChars(1);
|
||||
nextLine();
|
||||
c = '\n';
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user