Class: Rubinius::AST::Iter19

Inherits:
Iter
  • Object
show all
Defined in:
lib/compiler/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, #module?, #nest_scope, #new_local, #new_nested_local, #search_local, #sexp_name, #to_sexp

Methods included from Compiler::LocalVariables

#allocate_slot, #local_count, #local_names, #variables

Methods inherited from Node

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

Constructor Details

#initialize(line, arguments, body) ⇒ Iter19

Returns a new instance of Iter19.



342
343
344
345
346
347
348
349
350
351
352
# File 'lib/compiler/ast/sends.rb', line 342

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)


354
355
356
# File 'lib/compiler/ast/sends.rb', line 354

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