Class: CodeTools::AST::SValue
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.
218 219 220 221 |
# File 'lib/rubinius/ast/values.rb', line 218 def initialize(line, value) @line = line @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
216 217 218 |
# File 'lib/rubinius/ast/values.rb', line 216 def value @value end |
Instance Method Details
#bytecode(g) ⇒ Object
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/rubinius/ast/values.rb', line 223 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
241 242 243 |
# File 'lib/rubinius/ast/values.rb', line 241 def to_sexp [:svalue, @value.to_sexp] end |