Sha256: c996463aa22a64c790b4833d819659140fab449167aafc4b061e986fb26c7be8
Contents?: true
Size: 1.15 KB
Versions: 5
Compression:
Stored size: 1.15 KB
Contents
module ToSource class Emitter # Emitter for begin constructs class Begin < self handle(Rubinius::AST::Begin) private # Perform dispatch # # @return [undefined] # # @api private # def dispatch emit('begin') emit_body emit_end end # Emit body # # @return [undefined] # # @api private # def emit_body indent body = node.rescue case body when Rubinius::AST::Rescue emit_rescue(body) when Rubinius::AST::Ensure emit_ensure(body) else visit(body) unindent end end # Emit ensure # # @return [undefined] # # @api private # def emit_ensure(node) visit(node.body) unindent emit(:ensure) indented do visit(node.ensure) end end # Emit rescue # # @return [undefined] # # @api private # def emit_rescue(node) visit(node.body) unindent visit(node.rescue) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems