Skip to content

Commit

Permalink
Add docs to RubyVM::AbstractSyntaxTree.of
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
yui-knk committed Nov 11, 2018
1 parent 9f41da4 commit 66f239c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -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})
* # => #<RubyVM::AbstractSyntaxTree::Node(NODE_SCOPE(0) 1:35, 1:42): >
*
* def hello
* puts "hello, world"
* end
*
* RubyVM::AbstractSyntaxTree.of(method(:hello))
* # => #<RubyVM::AbstractSyntaxTree::Node(NODE_SCOPE(0) 1:0, 3:3): >
*/
static VALUE
rb_ast_s_of(VALUE module, VALUE body)
{
Expand Down

0 comments on commit 66f239c

Please sign in to comment.