-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
Description
The ruby parser considers CR to be a whitespace character, but IRB does not seem to do that.
This may result in an extra ^M at the end of a line when viewing the source from IRB.
How to reproduce
Save the following source code in CRLF newline on Windows and execute it on WSL.
def desc
"this file has CRLF newline"
end
binding.irb
$ ruby /mnt/r/crlf.rb
From: /mnt/r/crlf.rb @ line 4 :
1: def desc^M
2: "this file has CRLF newline"^M
3: end^M
=> 4: binding.irb^M
irb(main):001> show_source "desc"
From: /mnt/r/crlf.rb:1
def desc^M
"this file has CRLF newline"^M
end^M
=> nil
irb(main):002>
rubyFeedback
Metadata
Metadata
Assignees
Labels
No labels