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.
237 238 239 240 |
# File 'lib/rubinius/ast/values.rb', line 237 def initialize(line, value) @line = line @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
235 236 237 |
# File 'lib/rubinius/ast/values.rb', line 235 def value @value end |
Instance Method Details
#bytecode(g) ⇒ Object
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/rubinius/ast/values.rb', line 242 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
260 261 262 |
# File 'lib/rubinius/ast/values.rb', line 260 def to_sexp [:svalue, @value.to_sexp] end |