ast.c: update inspect results in the documents
This commit is contained in:
parent
48f3dc3cce
commit
4d93340d38
8
ast.c
8
ast.c
@ -83,7 +83,7 @@ ast_parse_done(rb_ast_t *ast)
|
|||||||
* SyntaxError is raised if the given _string_ is invalid syntax.
|
* SyntaxError is raised if the given _string_ is invalid syntax.
|
||||||
*
|
*
|
||||||
* RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
|
* RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
|
||||||
* # => #<RubyVM::AbstractSyntaxTree::Node(NODE_SCOPE(0) 1:0, 1:9): >
|
* # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:9>
|
||||||
*/
|
*/
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_ast_s_parse(VALUE module, VALUE str)
|
rb_ast_s_parse(VALUE module, VALUE str)
|
||||||
@ -112,7 +112,7 @@ rb_ast_parse_str(VALUE str)
|
|||||||
* valid Ruby syntax.
|
* valid Ruby syntax.
|
||||||
*
|
*
|
||||||
* RubyVM::AbstractSyntaxTree.parse_file("my-app/app.rb")
|
* RubyVM::AbstractSyntaxTree.parse_file("my-app/app.rb")
|
||||||
* # => #<RubyVM::AbstractSyntaxTree::Node(NODE_SCOPE(0) 1:0, 31:3): >
|
* # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-31:3>
|
||||||
*/
|
*/
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_ast_s_parse_file(VALUE module, VALUE path)
|
rb_ast_s_parse_file(VALUE module, VALUE path)
|
||||||
@ -208,14 +208,14 @@ script_lines(VALUE path)
|
|||||||
* Returns AST nodes of the given _proc_ or _method_.
|
* Returns AST nodes of the given _proc_ or _method_.
|
||||||
*
|
*
|
||||||
* RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
|
* RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
|
||||||
* # => #<RubyVM::AbstractSyntaxTree::Node(NODE_SCOPE(0) 1:35, 1:42): >
|
* # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:35-1:42>
|
||||||
*
|
*
|
||||||
* def hello
|
* def hello
|
||||||
* puts "hello, world"
|
* puts "hello, world"
|
||||||
* end
|
* end
|
||||||
*
|
*
|
||||||
* RubyVM::AbstractSyntaxTree.of(method(:hello))
|
* RubyVM::AbstractSyntaxTree.of(method(:hello))
|
||||||
* # => #<RubyVM::AbstractSyntaxTree::Node(NODE_SCOPE(0) 1:0, 3:3): >
|
* # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@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