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

Inherits:
Node
  • Object
show all
Includes:
LocalVariable
Defined in:
lib/rubinius/ast/definitions.rb

Instance Attribute Summary collapse

Attributes included from LocalVariable

#variable

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph, #attributes, #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, name) ⇒ BlockArgument

Returns a new instance of BlockArgument.



665
666
667
668
# File 'lib/rubinius/ast/definitions.rb', line 665

def initialize(line, name)
  @line = line
  @name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



663
664
665
# File 'lib/rubinius/ast/definitions.rb', line 663

def name
  @name
end

Instance Method Details

#bytecode(g) ⇒ Object



670
671
672
673
674
675
676
677
678
679
680
681
682
# File 'lib/rubinius/ast/definitions.rb', line 670

def bytecode(g)
  pos(g)

  g.push_proc

  if @variable.respond_to?(:depth) && @variable.depth != 0
    g.set_local_depth @variable.depth, @variable.slot
  else
    g.set_local @variable.slot
  end

  g.pop
end