Sha256: c83e16d1d4acb21411ef1c9f1e75da0b95138a3f4b2fcd8c82889288939ee4fc
Contents?: true
Size: 1.81 KB
Versions: 2
Compression:
Stored size: 1.81 KB
Contents
# encoding: utf-8 module Unparser class Emitter # Emitter for rescue body nodes class Resbody < self children :exception, :assignment, :body # Emitter for resbody in standalone form class Standalone < self private # Perform dispatch # # @return [undefined] # # @api private # def dispatch write(K_RESCUE) parentheses { visit(body) } end # Emit exception # # @return [undefined] # # @api private # def emit_exception return unless exception ws delimited(exception.children) end # Emit assignment # # @return [undefined] # # @api private # def emit_assignment return unless assignment write(WS, T_ASR, WS) visit(assignment) end end # Emitter for resbody in keyworkd-embedded form class Embedded < self handle :resbody private # Perform dispatch # # @return [undefined] # # @api private # def dispatch write(K_RESCUE) emit_exception emit_assignment emit_body end # Emit exception # # @return [undefined] # # @api private # def emit_exception return unless exception ws delimited(exception.children) end # Emit assignment # # @return [undefined] # # @api private # def emit_assignment return unless assignment write(WS, T_ASR, WS) visit(assignment) end end # Resbody end end # Emitter end # Unparser
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
unparser-0.1.9 | lib/unparser/emitter/resbody.rb |
unparser-0.1.8 | lib/unparser/emitter/resbody.rb |