Sha256: 5b1935db7b34ae115ce679313f6a9fe956ef87ced5ace3a8298de799b85d8095
Contents?: true
Size: 850 Bytes
Versions: 14
Compression:
Stored size: 850 Bytes
Contents
module Unparser class Emitter # Base class for binary emitters class Binary < self handle :or, :and children :left, :right MAP = { :or => T_OR, :and => T_AND }.freeze private # Perform dispatch # # @return [undefined] # # @api private # def dispatch parentheses do emit_left write(WS, MAP.fetch(node.type), WS) emit_right end end # Emit left # # @return [undefined] # # @api private # def emit_left parentheses { visit(left) } end # Emit right # # @return [undefined] # # @api private # def emit_right parentheses { visit(right) } end end # Binary end # Emitter end # Unparser
Version data entries
14 entries across 14 versions & 1 rubygems