Skip to content

Commit 6545f63

Browse files
authored
Merge pull request #3798 from ruby/handle-nested-heredoc
Nested heredoc with newline terminator
2 parents d5af773 + 8eeb5f3 commit 6545f63

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/prism.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12031,7 +12031,10 @@ parser_lex(pm_parser_t *parser) {
1203112031
// string content.
1203212032
if (heredoc_lex_mode->indent == PM_HEREDOC_INDENT_TILDE) {
1203312033
const uint8_t *end = parser->current.end;
12034-
pm_newline_list_append(&parser->newline_list, end);
12034+
12035+
if (parser->heredoc_end == NULL) {
12036+
pm_newline_list_append(&parser->newline_list, end);
12037+
}
1203512038

1203612039
// Here we want the buffer to only
1203712040
// include up to the backslash.

0 commit comments

Comments
 (0)