diff --git a/test/yarp/fixtures/newline-terminated-things.txt b/test/yarp/fixtures/newline-terminated-things.txt index 3faf45ab4a..ba07c085b0 100644 --- a/test/yarp/fixtures/newline-terminated-things.txt +++ b/test/yarp/fixtures/newline-terminated-things.txt @@ -1,3 +1,4 @@ +<<<<<<< HEAD:test/yarp/fixtures/newline-terminated-things.txt # note that %i, %I, %w, and %W do not support newline termination in CRuby % @@ -9,5 +10,7 @@ foo %Q foo +======= +>>>>>>> 0d5d759091 (fix: support newline-terminated regular expressions):test/fixtures/newline-terminated-things.txt %r foo diff --git a/test/yarp/snapshots/newline-terminated-things.txt b/test/yarp/snapshots/newline-terminated-things.txt index 946eb44a36..d01bd6a65a 100644 --- a/test/yarp/snapshots/newline-terminated-things.txt +++ b/test/yarp/snapshots/newline-terminated-things.txt @@ -1,3 +1,4 @@ +<<<<<<< HEAD:test/yarp/snapshots/newline-terminated-things.txt ProgramNode(76...106)( [], StatementsNode(76...106)( @@ -11,5 +12,11 @@ ProgramNode(76...106)( "foo", 0 )] +======= +ProgramNode(0...7)( + [], + StatementsNode(0...7)( + [RegularExpressionNode(0...7)((0...3), (3...6), (6...7), "foo", 0)] +>>>>>>> 0d5d759091 (fix: support newline-terminated regular expressions):test/snapshots/newline-terminated-things.txt ) ) diff --git a/yarp/yarp.c b/yarp/yarp.c index d521b7ead9..c425c53c1c 100644 --- a/yarp/yarp.c +++ b/yarp/yarp.c @@ -6369,7 +6369,13 @@ parser_lex(yp_parser_t *parser) { if (parser->current.end < parser->end) { lex_mode_push_regexp(parser, lex_mode_incrementor(*parser->current.end), lex_mode_terminator(*parser->current.end)); +<<<<<<< HEAD:yarp/yarp.c yp_newline_list_check_append(&parser->newline_list, parser->current.end); +======= + if (parser->current.end == '\n') { + yp_newline_list_append(&parser->newline_list, parser->current.end); + } +>>>>>>> 0d5d759091 (fix: support newline-terminated regular expressions):src/yarp.c parser->current.end++; }