Class: CodeTools::AST::Lambda
- Defined in:
- lib/rubinius/code/ast/definitions.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#body ⇒ Object
Returns the value of attribute body.
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
-
#initialize(line, arguments, body) ⇒ Lambda
constructor
A new instance of Lambda.
- #to_sexp ⇒ Object
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
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
332 333 334 |
# File 'lib/rubinius/code/ast/definitions.rb', line 332 def arguments @arguments end |
#body ⇒ Object
Returns the value of attribute body.
332 333 334 |
# File 'lib/rubinius/code/ast/definitions.rb', line 332 def body @body end |
Instance Method Details
#bytecode(g) ⇒ Object
340 341 342 343 344 345 346 |
# File 'lib/rubinius/code/ast/definitions.rb', line 340 def bytecode(g) pos(g) g.push_rubinius @body.bytecode(g) g.send_with_block :lambda, 0, false end |
#to_sexp ⇒ Object
348 349 350 |
# File 'lib/rubinius/code/ast/definitions.rb', line 348 def to_sexp [:lambda, @arguments.to_sexp, [:scope, @body.body.to_sexp]] end |