Created
November 14, 2016 21:02
-
-
Save anonymous/e8d615b73aa2c10ffba78917f2013e68 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# [4] pry(main)> Ripper.sexp('nil unless ip == "localhost" or ip.include? "."') | |
[:program, | |
[[:unless_mod, | |
[:binary, | |
[:binary, | |
[:vcall, [:@ident, "ip", [1, 11]]], | |
:==, | |
[:string_literal, | |
[:string_content, [:@tstring_content, "localhost", [1, 18]]]]], | |
:or, | |
[:command_call, | |
[:vcall, [:@ident, "ip", [1, 32]]], | |
:".", | |
[:@ident, "include?", [1, 35]], | |
[:args_add_block, | |
[[:string_literal, | |
[:string_content, [:@tstring_content, ".", [1, 45]]]]], | |
false]]], | |
[:var_ref, [:@kw, "nil", [1, 0]]]]]] | |
# [5] pry(main)> Ripper.sexp('nil unless ip == "localhost" || ip.include?(".")') | |
[:program, | |
[[:unless_mod, | |
[:binary, | |
[:binary, | |
[:vcall, [:@ident, "ip", [1, 11]]], | |
:==, | |
[:string_literal, | |
[:string_content, [:@tstring_content, "localhost", [1, 18]]]]], | |
:"||", | |
[:method_add_arg, | |
[:call, | |
[:vcall, [:@ident, "ip", [1, 32]]], | |
:".", | |
[:@ident, "include?", [1, 35]]], | |
[:arg_paren, | |
[:args_add_block, | |
[[:string_literal, | |
[:string_content, [:@tstring_content, ".", [1, 45]]]]], | |
false]]]], | |
[:var_ref, [:@kw, "nil", [1, 0]]]]]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment