[ruby/prism] Handle CLRF inside heredoc contents

1fbac72485
This commit is contained in:
Kevin Newton 2024-03-25 08:32:58 -04:00
parent a31ca3500d
commit 14ab698967
12 changed files with 32 additions and 30 deletions

View file

@ -52,25 +52,10 @@ module Prism
whitequark/string_concat.txt
]
# These files contain CRLF line endings, which ruby_parser translates into
# LF before it gets back to the node. This means the node actually has the
# wrong contents.
crlf = %w[
dos_endings.txt
heredoc_with_comment.txt
seattlerb/heredoc__backslash_dos_format.txt
seattlerb/heredoc_with_carriage_return_escapes_windows.txt
seattlerb/heredoc_with_extra_carriage_horrible_mix.txt
seattlerb/heredoc_with_extra_carriage_returns_windows.txt
seattlerb/heredoc_with_extra_carriage_returns.txt
seattlerb/heredoc_with_interpolation_and_carriage_return_escapes_windows.txt
seattlerb/heredoc_with_only_carriage_returns_windows.txt
seattlerb/heredoc_with_only_carriage_returns.txt
]
# https://github.com/seattlerb/ruby_parser/issues/344
failures = crlf | %w[
failures = %w[
alias.txt
dos_endings.txt
heredocs_with_ignored_newlines.txt
method_calls.txt
methods.txt
@ -79,8 +64,10 @@ module Prism
patterns.txt
regex.txt
seattlerb/and_multi.txt
seattlerb/heredoc__backslash_dos_format.txt
seattlerb/heredoc_bad_hex_escape.txt
seattlerb/heredoc_bad_oct_escape.txt
seattlerb/heredoc_with_extra_carriage_horrible_mix.txt
spanning_heredoc_newlines.txt
spanning_heredoc.txt
tilde_heredocs.txt