Add docs to RubyVM::AbstractSyntaxTree.of
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9f41da42eb
commit
66f239c537
17
ast.c
17
ast.c
@ -200,6 +200,23 @@ script_lines(VALUE path)
|
|||||||
return lines;
|
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
|
static VALUE
|
||||||
rb_ast_s_of(VALUE module, VALUE body)
|
rb_ast_s_of(VALUE module, VALUE body)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user