sexp(src, filename = '-', lineno = 1)
Class Public methods
- EXPERIMENTAL
-
Parses
src
and create S-exp tree. Returns more readable tree rather than ::sexp_raw. This method is mainly for developer use.require 'ripper' require 'pp' pp Ripper.sexp("def m(a) nil end") #=> [:program, [[:def, [:@ident, "m", [1, 4]], [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil, nil]], [:bodystmt, [[:var_ref, [:@kw, "nil", [1, 9]]]], nil, nil, nil]]]]
Please login to continue.