You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(a) The \r\n gsub can be removed (and therefore have the parser instead of the buffer replace \r\n when necessary)
(b) The Buffer class could support an auto_clrf parameter (or something) that would disable that behavior
The text was updated successfully, but these errors were encountered:
When you parse source that contains \r\n in the source, they are automatically converted into \n, as per
parser/lib/parser/source/buffer.rb
Line 190 in 8bd5ec3
This is saying the source range is
4...5
, which is one of the\r
characters.For prism's purposes it's okay if the locations are different, I'll just make it so that it doesn't compare locations for files that contain
\r\n
. My issue is that I use the source buffer to parse with both parsers (https://github.com/ruby/prism/blob/90d570aa50bfff43c66e5f6c600370a61c091329/test/prism/ruby/parser_test.rb#L188-L208) but the source has already been modified internally in the buffer with no way to retrieve the original.For a solution, I'm wondering if either:
(a) The
\r\n
gsub can be removed (and therefore have the parser instead of the buffer replace \r\n when necessary)(b) The
Buffer
class could support anauto_clrf
parameter (or something) that would disable that behaviorThe text was updated successfully, but these errors were encountered: