Class: CodeTools::AST::InstanceVariableAccess
Instance Attribute Summary
#name
Attributes inherited from Node
#line
Instance Method Summary
collapse
#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
Instance Method Details
#bytecode(g) ⇒ Object
424
425
426
427
428
|
# File 'lib/rubinius/code/ast/variables.rb', line 424
def bytecode(g)
pos(g)
g.push_ivar @name
end
|
#defined(g) ⇒ Object
437
438
439
440
441
442
443
444
445
446
447
448
449
|
# File 'lib/rubinius/code/ast/variables.rb', line 437
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_sexp ⇒ Object
451
452
453
|
# File 'lib/rubinius/code/ast/variables.rb', line 451
def to_sexp
[:ivar, @name]
end
|
#variable_defined(g, f) ⇒ Object
430
431
432
433
434
435
|
# File 'lib/rubinius/code/ast/variables.rb', line 430
def variable_defined(g, f)
g.push_self
g.push_literal @name
g.send :__instance_variable_defined_p__, 1
g.goto_if_false f
end
|