mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Fix not shifting CRLF at end of raw lines
Fixes line reporting errors on Windows
This commit is contained in:
@@ -1777,7 +1777,7 @@ static int yylex_RAW(void)
|
|||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
return 0;
|
return 0;
|
||||||
shiftChars(1);
|
shiftChars(1);
|
||||||
if (c == '\r' && peek(0) == '\r')
|
if (c == '\r' && peek(0) == '\n')
|
||||||
shiftChars(1);
|
shiftChars(1);
|
||||||
return c == ',' ? T_COMMA : T_NEWLINE;
|
return c == ',' ? T_COMMA : T_NEWLINE;
|
||||||
}
|
}
|
||||||
@@ -2033,10 +2033,8 @@ void lexer_CaptureRept(char **capture, size_t *size)
|
|||||||
error("Unterminated REPT block\n");
|
error("Unterminated REPT block\n");
|
||||||
lexerState->capturing = false;
|
lexerState->capturing = false;
|
||||||
goto finish;
|
goto finish;
|
||||||
} else if (c == '\n') {
|
} else if (c == '\n' || c == '\r') {
|
||||||
break;
|
if (c == '\r' && peek(0) == '\n')
|
||||||
} else if (c == '\r') {
|
|
||||||
if (peek(0) == '\n')
|
|
||||||
shiftChars(1);
|
shiftChars(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user