Sha256: a7a2b760d00859514d183a619cf57f42a57be0d46b4a50518d3c676549b16559

Contents?: true

Size: 538 Bytes

Versions: 4

Compression:

Stored size: 538 Bytes

Contents

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.3 lib/unparser/emitter/flipflop.rb
unparser-0.1.2 lib/unparser/emitter/flipflop.rb
unparser-0.1.1 lib/unparser/emitter/flipflop.rb
unparser-0.1.0 lib/unparser/emitter/flipflop.rb