From 859799effeeb902d60309eba8de7dfaa8d9ebd05 Mon Sep 17 00:00:00 2001 From: momoyon Date: Sun, 11 May 2025 11:12:36 +0500 Subject: [PATCH] [main.c] Fix lexing of newlines (\r\n VS \n)... - [tests/suffix_parsing] Update expected output. --- main.c | 2 +- tests/.suffix_parsing.build.out.expected | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 61bb742..2569dc8 100644 --- a/main.c +++ b/main.c @@ -1216,7 +1216,7 @@ void consume_comment(Lexer *l, String_view *sv_out, Location *loc_out) { void left_trim(Lexer *l) { while (!eof(l) && isspace(current_char(l))) { - if (current_char(l) == '\n' || (current_char(l) == '\r' && next_char(l) == '\n')) { + if (current_char(l) == '\n') { Line line = { .offset = l->bol, .count = col(l), diff --git a/tests/.suffix_parsing.build.out.expected b/tests/.suffix_parsing.build.out.expected index d9b24b5..a5be7eb 100644 --- a/tests/.suffix_parsing.build.out.expected +++ b/tests/.suffix_parsing.build.out.expected @@ -1,4 +1,4 @@ suffix_parsing.momo:1:0 [UNARY] '([IDENT] 'foo': ???) ++ ' -suffix_parsing.momo:3:0 [UNARY] '([IDENT] 'bar': ???) -- ' -suffix_parsing.momo:5:0 [UNARY] '([IDENT] 'a': ???) ++ ' -suffix_parsing.momo:5:5 [UNARY] '([IDENT] 'b': ???) -- ' +suffix_parsing.momo:2:0 [UNARY] '([IDENT] 'bar': ???) -- ' +suffix_parsing.momo:3:0 [UNARY] '([IDENT] 'a': ???) ++ ' +suffix_parsing.momo:3:5 [UNARY] '([IDENT] 'b': ???) -- ' -- 2.39.5