class Parser::AST::Node

{Parser::AST::Node} contains information about a single AST node and its child nodes. It extends the basic [AST::Node](rdoc.info/gems/ast/AST/Node) class provided by gem [ast](rdoc.info/gems/ast).

@api public

@!attribute [r] location

Source map for this Node.
@return [Parser::Source::Map]

Attributes

loc[R]
location[R]

Public Instance Methods

assign_properties(properties) click to toggle source

Assigns various properties to this AST node. Currently only the location can be set.

@param [Hash] properties @option properties [Parser::Source::Map] :location Location information

of the node.
# File lib/parser/ast/node.rb, line 30
def assign_properties(properties)
  if (location = properties[:location])
    location = location.dup if location.frozen?
    location.node = self
    @location = location
  end
end