Fix CRLF being significant inside of strings, now strings are normalized to \n only and the same output regardless of the file line endings (see #988)

https://github.com/wren-lang/wren/issues/988#issuecomment-842670624
This commit is contained in:
ruby0x1
2021-05-21 16:24:12 -07:00
parent d78f481079
commit 59e496e26a

View File

@ -911,6 +911,8 @@ static void readRawString(Parser* parser)
char c1 = peekChar(parser);
char c2 = peekNextChar(parser);
if (c == '\r') continue;
if(c == '\n') {
lastNewline = string.count;
skipEnd = lastNewline;
@ -975,6 +977,7 @@ static void readString(Parser* parser)
{
char c = nextChar(parser);
if (c == '"') break;
if (c == '\r') continue;
if (c == '\0')
{