Class: Rubinius::ToolSet.current::TS::AST::SendWithArguments
- Defined in:
- lib/rubinius/ast/sends.rb
Direct Known Subclasses
AttributeAssignment, CallCustom, CheckFrozen, ElementAssignment, InlineAssembly, InvokePrimitive, SendFastCoerceTo, SendFastNew, SendKernelMethod, SendPrimitive, SingleBlockArg, Super, Yield
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
Attributes inherited from Send
#block, #name, #privately, #receiver, #variable, #vcall_style
Attributes inherited from Node
Instance Method Summary collapse
- #arguments_sexp(name = :arglist) ⇒ Object
- #bytecode(g) ⇒ Object
-
#initialize(line, receiver, name, arguments, privately = false) ⇒ SendWithArguments
constructor
A new instance of SendWithArguments.
Methods inherited from Send
#check_local_reference, #defined, #receiver_sexp, #sexp_name, #to_sexp, #value_defined
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, #to_sexp, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk
Constructor Details
#initialize(line, receiver, name, arguments, privately = false) ⇒ SendWithArguments
Returns a new instance of SendWithArguments.
134 135 136 137 138 |
# File 'lib/rubinius/ast/sends.rb', line 134 def initialize(line, receiver, name, arguments, privately=false) super line, receiver, name, privately @block = nil @arguments = ActualArguments.new line, arguments end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
132 133 134 |
# File 'lib/rubinius/ast/sends.rb', line 132 def arguments @arguments end |
Instance Method Details
#arguments_sexp(name = :arglist) ⇒ Object
157 158 159 160 161 |
# File 'lib/rubinius/ast/sends.rb', line 157 def arguments_sexp(name=:arglist) sexp = [name] + @arguments.to_sexp sexp << @block.to_sexp if @block sexp end |
#bytecode(g) ⇒ Object
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/rubinius/ast/sends.rb', line 140 def bytecode(g) @receiver.bytecode(g) @arguments.bytecode(g) pos(g) if @arguments.splat? @block ? @block.bytecode(g) : g.push(:nil) g.send_with_splat @name, @arguments.size, @privately, false elsif @block @block.bytecode(g) g.send_with_block @name, @arguments.size, @privately else g.send @name, @arguments.size, @privately end end |