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

Inherits:
Node
  • Object
show all
Includes:
LocalVariable
Defined in:
lib/rubinius/ast/variables.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) ⇒ SplatPatternVariable

Returns a new instance of SplatPatternVariable.



779
780
781
782
783
# File 'lib/rubinius/ast/variables.rb', line 779

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



777
778
779
# File 'lib/rubinius/ast/variables.rb', line 777

def name
  @name
end

#valueObject

Returns the value of attribute value.



777
778
779
# File 'lib/rubinius/ast/variables.rb', line 777

def value
  @value
end

Instance Method Details

#bytecode(g) ⇒ Object



790
791
792
793
794
795
796
797
798
799
800
# File 'lib/rubinius/ast/variables.rb', line 790

def bytecode(g)
  pos(g)

  unless @variable
    g.state.scope.assign_local_reference self
  end

  g.dup
  @variable.set_bytecode(g)
  g.pop
end

#position_bytecode(g) ⇒ Object



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

def position_bytecode(g)
  @variable.get_bytecode(g)
  g.cast_array
end