RubyVM::AbstractSyntaxTree::Node instances are created by parse methods in RubyVM::AbstractSyntaxTree.

This class is MRI specific.

Instance Methods

Returns AST nodes under this one. Each kind of node has different children, depending on what kind of node it is.

The returned array may contain other nodes or nil.

The column number in the source code where this AST’s text began.

The line number in the source code where this AST’s text began.

Returns debugging information about this node as a string.

The column number in the source code where this AST’s text ended.

The line number in the source code where this AST’s text ended.

No documentation available
No documentation available

Returns the type of this node as a symbol.

root = RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
root.type # => :SCOPE
lasgn = root.children[2]
lasgn.type # => :LASGN
call = lasgn.children[1]
call.type # => :OPCALL