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

Inherits:
VariableAccess show all
Defined in:
lib/rubinius/ast/variables.rb

Instance Attribute Summary

Attributes inherited from VariableAccess

#name

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from VariableAccess

#initialize, #value_defined

Methods inherited from Node

#ascii_graph, #attributes, #children, #initialize, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, #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::VariableAccess

Instance Method Details

#bytecode(g) ⇒ Object



426
427
428
429
430
# File 'lib/rubinius/ast/variables.rb', line 426

def bytecode(g)
  pos(g)

  g.push_ivar @name
end

#defined(g) ⇒ Object



439
440
441
442
443
444
445
446
447
448
449
450
451
# File 'lib/rubinius/ast/variables.rb', line 439

def defined(g)
  f = g.new_label
  done = g.new_label

  variable_defined(g, f)
  g.push_literal "instance-variable"
  g.goto done

  f.set!
  g.push :nil

  done.set!
end

#to_sexpObject



453
454
455
# File 'lib/rubinius/ast/variables.rb', line 453

def to_sexp
  [:ivar, @name]
end

#variable_defined(g, f) ⇒ Object



432
433
434
435
436
437
# File 'lib/rubinius/ast/variables.rb', line 432

def variable_defined(g, f)
  g.push :self
  g.push_literal @name
  g.send :__instance_variable_defined_p__, 1
  g.gif f
end