Class: CodeTools::AST::PushArguments

Inherits:
Node
  • Object
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, node) ⇒ PushArguments

Returns a new instance of PushArguments.



370
371
372
373
374
# File 'lib/rubinius/code/ast/sends.rb', line 370

def initialize(line, node)
  @line = line
  @arguments = node.arguments
  @value = node.value
end

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



368
369
370
# File 'lib/rubinius/code/ast/sends.rb', line 368

def arguments
  @arguments
end

Instance Method Details

#bytecode(g) ⇒ Object



384
385
386
387
# File 'lib/rubinius/code/ast/sends.rb', line 384

def bytecode(g)
  @arguments.bytecode(g)
  @value.bytecode(g)
end

#sizeObject



376
377
378
# File 'lib/rubinius/code/ast/sends.rb', line 376

def size
  splat? ? 1 : @arguments.size + 1
end

#splat?Boolean

Returns:

  • (Boolean)


380
381
382
# File 'lib/rubinius/code/ast/sends.rb', line 380

def splat?
  @arguments.splat?
end

#to_sexpObject



389
390
391
# File 'lib/rubinius/code/ast/sends.rb', line 389

def to_sexp
  [:argspush, @arguments.to_sexp, @value.to_sexp]
end