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

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

Instance Attribute Summary

Attributes inherited from Iter

#arguments, #body, #parent

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Iter

#assign_local_reference, #bytecode, #module?, #nest_scope, #new_local, #new_nested_local, #search_local, #sexp_name, #to_sexp

Methods inherited from Node

#ascii_graph, #attributes, #bytecode, #children, #defined, 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

#initialize(line, arguments, body) ⇒ Iter19

Returns a new instance of Iter19.



611
612
613
614
615
616
617
618
619
620
621
# File 'lib/rubinius/ast/sends.rb', line 611

def initialize(line, arguments, body)
  @line = line
  @arguments = arguments || IterArguments.new(line, nil)
  @body = body || NilLiteral.new(line)

  if @body.kind_of?(Block) and @body.locals
    @locals = @body.locals.body.map { |x| x.value }
  else
    @locals = nil
  end
end

Instance Method Details

#block_local?(name) ⇒ Boolean

Returns:

  • (Boolean)


623
624
625
# File 'lib/rubinius/ast/sends.rb', line 623

def block_local?(name)
  @locals.include?(name) if @locals
end