Class: CodeTools::AST::BlockPass
- Inherits:
-
Node
- Object
- Node
- CodeTools::AST::BlockPass
show all
- Defined in:
- lib/rubinius/code/ast/sends.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, body) ⇒ BlockPass
Returns a new instance of BlockPass.
338
339
340
341
|
# File 'lib/rubinius/code/ast/sends.rb', line 338
def initialize(line, body)
@line = line
@body = body
end
|
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
336
337
338
|
# File 'lib/rubinius/code/ast/sends.rb', line 336
def body
@body
end
|
Instance Method Details
#assignment_bytecode(g) ⇒ Object
363
364
365
366
|
# File 'lib/rubinius/code/ast/sends.rb', line 363
def assignment_bytecode(g)
g.push_proc
@body.bytecode(g)
end
|
#bytecode(g) ⇒ Object
358
359
360
361
|
# File 'lib/rubinius/code/ast/sends.rb', line 358
def bytecode(g)
@body.bytecode(g)
convert(g)
end
|
#convert(g) ⇒ Object
343
344
345
346
347
348
349
350
351
352
353
354
355
356
|
# File 'lib/rubinius/code/ast/sends.rb', line 343
def convert(g)
nil_block = g.new_label
g.dup
g.is_nil
g.git nil_block
g.push_cpath_top
g.find_const :Proc
g.swap
g.send :__from_block__, 1
nil_block.set!
end
|
#to_sexp ⇒ Object
368
369
370
|
# File 'lib/rubinius/code/ast/sends.rb', line 368
def to_sexp
[:block_pass, @body.to_sexp]
end
|