Class: CodeTools::AST::RescueSplat

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

Returns a new instance of RescueSplat.



543
544
545
546
# File 'lib/rubinius/code/ast/exceptions.rb', line 543

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

Instance Attribute Details

#valueObject

Returns the value of attribute value.



541
542
543
# File 'lib/rubinius/code/ast/exceptions.rb', line 541

def value
  @value
end

Instance Method Details

#bytecode(g, body) ⇒ Object



548
549
550
551
552
553
554
555
556
557
# File 'lib/rubinius/code/ast/exceptions.rb', line 548

def bytecode(g, body)
  pos(g)

  g.dup
  @value.bytecode(g)
  g.cast_array
  g.swap
  g.send :__rescue_match__, 1
  g.goto_if_true body
end

#to_sexpObject



559
560
561
# File 'lib/rubinius/code/ast/exceptions.rb', line 559

def to_sexp
  [:splat, @value.to_sexp]
end