Class: Rubinius::ToolSet.current::TS::AST::PushArgs

Inherits:
Node
  • Object
show all
Defined in:
lib/rubinius/ast/values.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, arguments, value) ⇒ PushArgs

Returns a new instance of PushArgs.



76
77
78
79
80
# File 'lib/rubinius/ast/values.rb', line 76

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

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



74
75
76
# File 'lib/rubinius/ast/values.rb', line 74

def arguments
  @arguments
end

#valueObject

Returns the value of attribute value.



74
75
76
# File 'lib/rubinius/ast/values.rb', line 74

def value
  @value
end

Instance Method Details

#bytecode(g) ⇒ Object



82
83
84
85
86
87
# File 'lib/rubinius/ast/values.rb', line 82

def bytecode(g)
  @arguments.bytecode(g)
  @value.bytecode(g)
  g.make_array 1
  g.send :+, 1
end

#sizeObject



93
94
95
# File 'lib/rubinius/ast/values.rb', line 93

def size
  1
end

#splat?Boolean

Returns:

  • (Boolean)


97
98
99
# File 'lib/rubinius/ast/values.rb', line 97

def splat?
  @arguments.splat?
end

#to_sexpObject



89
90
91
# File 'lib/rubinius/ast/values.rb', line 89

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