Skip to content

Instantly share code, notes, and snippets.

@JacobNinja
Created January 22, 2015 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JacobNinja/0032e88f980f217bc61f to your computer and use it in GitHub Desktop.
Save JacobNinja/0032e88f980f217bc61f to your computer and use it in GitHub Desktop.
' vs " in MRI parser
irb(main):002:0> Ripper.sexp "'foo'"
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo", [1, 1]]]]]]
irb(main):003:0> Ripper.sexp '"foo"'
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo", [1, 1]]]]]]
irb(main):004:0> Ripper.sexp '"#{foo}"'
=> [:program, [[:string_literal, [:string_content, [:string_embexpr, [[:vcall, [:@ident, "foo", [1, 3]]]]]]]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment