Class: Duby::AST::JRubyAst::RescueBodyNode

Inherits:
Object
  • Object
show all
Defined in:
lib/duby/transform.rb

Instance Method Summary collapse

Instance Method Details

#transform(transformer, parent) ⇒ Object



807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
# File 'lib/duby/transform.rb', line 807

def transform(transformer, parent)
  children = if opt_rescue_node
    transformer.transform(opt_rescue_node, parent)
  else
    []
  end
  [
    RescueClause.new(parent, position) do |clause|
      exceptions = if exception_nodes
        exception_nodes.map {|e| e.type_reference(clause)}
      else
        [AST.type('java.lang.Exception')]
      end
      [
        exceptions,
        transformer.transform(body_node, clause)
      ]
    end,
    *children
  ]
end