Class: Rubinius::AST::BlockPass
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
Attributes inherited from Node
Instance Method Summary collapse
- #convert(g) ⇒ Object
-
#initialize(line, body) ⇒ BlockPass
constructor
A new instance of BlockPass.
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk
Constructor Details
#initialize(line, body) ⇒ BlockPass
Returns a new instance of BlockPass.
149 150 151 152 |
# File 'lib/compiler/ast/sends.rb', line 149 def initialize(line, body) @line = line @body = body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
147 148 149 |
# File 'lib/compiler/ast/sends.rb', line 147 def body @body end |
Instance Method Details
#convert(g) ⇒ Object
154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/compiler/ast/sends.rb', line 154 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
169 170 171 |
# File 'lib/compiler/ast/sends.rb', line 169 def to_sexp [:block_pass, @body.to_sexp] end |