Created
October 21, 2016 07:32
-
-
Save olivernn/9e61a52aaa05656210b839d9c8594bd8 to your computer and use it in GitHub Desktop.
RubyWat Implicit String Concatenation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'abc' | |
[:program, | |
[[:string_literal, [:string_content, [:@tstring_content, "abc", [1, 1]]]]]] | |
'a' 'b' 'c' | |
[:program, | |
[[:string_concat, | |
[:string_concat, | |
[:string_literal, [:string_content, [:@tstring_content, "a", [1, 1]]]], | |
[:string_literal, [:string_content, [:@tstring_content, "b", [1, 5]]]]], | |
[:string_literal, [:string_content, [:@tstring_content, "c", [1, 9]]]]]]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ripper' | |
require 'pp' | |
puts "'abc'" | |
pp Ripper.sexp("'abc'") | |
puts "\n'a' 'b' 'c'" | |
pp Ripper.sexp("'a' 'b' 'c'") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment