Class: RubyVM::AbstractSyntaxTree::Node
Overview
Node
instances are created by parse methods in ::RubyVM::AbstractSyntaxTree
.
This class is MRI specific.
Instance Method Summary
-
#children ⇒ Array
Returns AST nodes under this one.
-
#first_column ⇒ Integer
The column number in the source code where this AST’s text began.
-
#first_lineno ⇒ Integer
The line number in the source code where this AST’s text began.
-
#inspect ⇒ String
Returns debugging information about this node as a string.
-
#last_column ⇒ Integer
The column number in the source code where this AST’s text ended.
-
#last_lineno ⇒ Integer
The line number in the source code where this AST’s text ended.
-
#type ⇒ Symbol
Returns the type of this node as a symbol.
Instance Method Details
#children ⇒ Array
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
.
# File 'ast.rb', line 133
def children Primitive.ast_node_children end
#first_column ⇒ Integer
The column number in the source code where this AST’s text began.
# File 'ast.rb', line 106
def first_column Primitive.ast_node_first_column end
#first_lineno ⇒ Integer
The line number in the source code where this AST’s text began.
# File 'ast.rb', line 98
def first_lineno Primitive.ast_node_first_lineno end
#inspect ⇒ String
Returns debugging information about this node as a string.
# File 'ast.rb', line 141
def inspect Primitive.ast_node_inspect end
#last_column ⇒ Integer
The column number in the source code where this AST’s text ended.
# File 'ast.rb', line 122
def last_column Primitive.ast_node_last_column end
#last_lineno ⇒ Integer
The line number in the source code where this AST’s text ended.
# File 'ast.rb', line 114
def last_lineno Primitive.ast_node_last_lineno end
#type ⇒ Symbol
# File 'ast.rb', line 90
def type Primitive.ast_node_type end