Class: CodeTools::AST::Undef

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

Instance Attribute Summary collapse

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, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk

Constructor Details

#initialize(line, sym) ⇒ Undef

Returns a new instance of Undef.



48
49
50
51
# File 'lib/rubinius/code/ast/definitions.rb', line 48

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



46
47
48
# File 'lib/rubinius/code/ast/definitions.rb', line 46

def name
  @name
end

Instance Method Details

#bytecode(g) ⇒ Object



53
54
55
56
57
58
59
# File 'lib/rubinius/code/ast/definitions.rb', line 53

def bytecode(g)
  pos(g)

  g.push_scope
  @name.bytecode(g)
  g.send :__undef_method__, 1
end

#to_sexpObject



61
62
63
# File 'lib/rubinius/code/ast/definitions.rb', line 61

def to_sexp
  [:undef, @name.to_sexp]
end