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

Inherits:
Node
  • Object
show all
Defined in:
lib/rubinius/ast/values.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, #visit, #walk

Constructor Details

#initialize(line, value) ⇒ ToString

Returns a new instance of ToString.



157
158
159
160
# File 'lib/rubinius/ast/values.rb', line 157

def initialize(line, value)
  @line = line
  @value = value
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



155
156
157
# File 'lib/rubinius/ast/values.rb', line 155

def value
  @value
end

Instance Method Details

#bytecode(g) ⇒ Object



162
163
164
165
166
167
# File 'lib/rubinius/ast/values.rb', line 162

def bytecode(g)
  pos(g)

  @value.bytecode(g)
  g.meta_to_s
end

#to_sexpObject



175
176
177
178
179
# File 'lib/rubinius/ast/values.rb', line 175

def to_sexp
  sexp = [:evstr]
  sexp << @value.to_sexp if @value
  sexp
end

#value_defined(g, f) ⇒ Object



169
170
171
172
173
# File 'lib/rubinius/ast/values.rb', line 169

def value_defined(g, f)
  if @value
    @value.value_defined(g, f)
  end
end