diff --git a/ast.c b/ast.c index 33e7ba4c8c..afed691a7d 100644 --- a/ast.c +++ b/ast.c @@ -200,6 +200,23 @@ script_lines(VALUE path) return lines; } +/* + * call-seq: + * RubyVM::AbstractSyntaxTree.of(proc) -> RubyVM::AbstractSyntaxTree::Node + * RubyVM::AbstractSyntaxTree.of(method) -> RubyVM::AbstractSyntaxTree::Node + * + * Returns AST nodes of the given proc or method. + * + * RubyVM::AbstractSyntaxTree.of(proc {1 + 2}) + * # => # + * + * def hello + * puts "hello, world" + * end + * + * RubyVM::AbstractSyntaxTree.of(method(:hello)) + * # => # + */ static VALUE rb_ast_s_of(VALUE module, VALUE body) {