From 59e496e26a7066145dfcc2c41123d8405e6b0d5f Mon Sep 17 00:00:00 2001 From: ruby0x1 Date: Fri, 21 May 2021 16:24:12 -0700 Subject: [PATCH] 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 --- src/vm/wren_compiler.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vm/wren_compiler.c b/src/vm/wren_compiler.c index a316b864..4db99fdd 100644 --- a/src/vm/wren_compiler.c +++ b/src/vm/wren_compiler.c @@ -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') {