Sha256: 5f8e8e32ed7be4cd8a5e7a052f16ed03b8550d4b134480f59b908546abdf7053

Contents?: true

Size: 551 Bytes

Versions: 4

Compression:

Stored size: 551 Bytes

Contents

# encoding: utf-8

module Unparser
  class Emitter
    # Emitter for flip flops
    class FlipFlop < self

      MAP = IceNine.deep_freeze(
        iflipflop: '..',
        eflipflop: '...',
      ).freeze

      handle(*MAP.keys)

      children :left, :right

    private

      # Perform dispatch
      #
      # @return [undefined]
      #
      # @api private
      #
      def dispatch
        visit_terminated(left)
        write(MAP.fetch(node.type))
        visit_terminated(right)
      end
    end # FlipFLop
  end # Emitter
end # Unparser

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
unparser-0.1.9 lib/unparser/emitter/flipflop.rb
unparser-0.1.8 lib/unparser/emitter/flipflop.rb
unparser-0.1.7 lib/unparser/emitter/flipflop.rb
unparser-0.1.6 lib/unparser/emitter/flipflop.rb