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

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

Direct Known Subclasses

PreExe19

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph, #attributes, #bytecode, #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) ⇒ PreExe

Returns a new instance of PreExe.



257
258
259
# File 'lib/rubinius/ast/sends.rb', line 257

def initialize(line)
  @line = line
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



255
256
257
# File 'lib/rubinius/ast/sends.rb', line 255

def block
  @block
end

Instance Method Details

#pre_bytecode(g) ⇒ Object



261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/rubinius/ast/sends.rb', line 261

def pre_bytecode(g)
  pos(g)

  g.push_state ClosedScope.new(@line)
  g.state.push_name :BEGIN

  g.push_literal Compiler::Runtime
  @block.bytecode(g)
  g.send_with_block :pre_exe, 0, false

  g.state.pop_name
  g.pop_state
end

#pre_sexpObject



278
279
280
# File 'lib/rubinius/ast/sends.rb', line 278

def pre_sexp
  @block.to_sexp.insert 1, :pre_exe
end

#to_sexpObject



275
276
# File 'lib/rubinius/ast/sends.rb', line 275

def to_sexp
end