Class: CodeTools::AST::Defined

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, expr) ⇒ Defined

Returns a new instance of Defined.



1278
1279
1280
1281
# File 'lib/rubinius/code/ast/definitions.rb', line 1278

def initialize(line, expr)
  @line = line
  @expression = expr
end

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



1276
1277
1278
# File 'lib/rubinius/code/ast/definitions.rb', line 1276

def expression
  @expression
end

Instance Method Details

#bytecode(g) ⇒ Object



1283
1284
1285
1286
1287
# File 'lib/rubinius/code/ast/definitions.rb', line 1283

def bytecode(g)
  pos(g)

  @expression.defined(g)
end

#to_sexpObject



1289
1290
1291
# File 'lib/rubinius/code/ast/definitions.rb', line 1289

def to_sexp
  [:defined, @expression.to_sexp]
end