Class: Rubinius::ToolSet.current::TS::AST::SValue
- Defined in:
- lib/rubinius/ast/values.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
-
#initialize(line, value) ⇒ SValue
constructor
A new instance of SValue.
- #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
#initialize(line, value) ⇒ SValue
Returns a new instance of SValue.
106 107 108 109 |
# File 'lib/rubinius/ast/values.rb', line 106 def initialize(line, value) @line = line @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
104 105 106 |
# File 'lib/rubinius/ast/values.rb', line 104 def value @value end |
Instance Method Details
#bytecode(g) ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/rubinius/ast/values.rb', line 111 def bytecode(g) @value.bytecode(g) if @value.kind_of? SplatValue done = g.new_label g.dup g.send :size, 0 g.push 1 g.send :>, 1 g.git done g.push 0 g.send :at, 1 done.set! end end |
#to_sexp ⇒ Object
129 130 131 |
# File 'lib/rubinius/ast/values.rb', line 129 def to_sexp [:svalue, @value.to_sexp] end |