For example
irb(main):003:0> p Ripper.sexp("5 + 5")
[:program, [[:binary, [:@int, "5", [1, 0]], :+, [:@int, "5", [1, 4]]]]] => [:program, [[:binary, [:@int, "5", [1, 0]], :+, [:@int, "5", [1, 4]]]]]
and how it calls the reserved words
irb(main):007:0> p Ripper.sexp("puts")
[:program, [[:var_ref, [:@ident, "puts", [1, 0]]]]] => [:program, [[:var_ref, [:@ident, "puts", [1, 0]]]]]
0 Comments