Class: Rubinius::ToolSet.current::TS::AST::For

Inherits:
Iter
  • Object
show all
Defined in:
lib/rubinius/ast/sends.rb

Direct Known Subclasses

For19

Instance Attribute Summary

Attributes inherited from Iter

#arguments, #body, #parent

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Iter

#block_local?, #bytecode, #initialize, #module?, #new_local, #to_sexp

Methods inherited from Node

#ascii_graph, #attributes, #bytecode, #children, #initialize, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, #to_sexp, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk

Constructor Details

This class inherits a constructor from Rubinius::ToolSet.current::TS::AST::Iter

Instance Method Details

#assign_local_reference(var) ⇒ Object



803
804
805
806
807
808
809
# File 'lib/rubinius/ast/sends.rb', line 803

def assign_local_reference(var)
  unless reference = search_local(var.name)
    reference = new_nested_local var.name
  end

  var.variable = reference
end

#defined(g) ⇒ Object



811
812
813
# File 'lib/rubinius/ast/sends.rb', line 811

def defined(g)
  g.push_literal "expression"
end

#nest_scope(scope) ⇒ Object



786
787
788
# File 'lib/rubinius/ast/sends.rb', line 786

def nest_scope(scope)
  scope.parent = self
end

#new_nested_local(name) ⇒ Object



797
798
799
800
801
# File 'lib/rubinius/ast/sends.rb', line 797

def new_nested_local(name)
  reference = @parent.new_nested_local name
  reference.depth += 1
  reference
end

#search_local(name) ⇒ Object



790
791
792
793
794
795
# File 'lib/rubinius/ast/sends.rb', line 790

def search_local(name)
  if reference = @parent.search_local(name)
    reference.depth += 1
    reference
  end
end

#sexp_nameObject



815
816
817
# File 'lib/rubinius/ast/sends.rb', line 815

def sexp_name
  :for
end