Sha256: bf8215826c8bbc376c41f57b96799cbc5b84964500ae65858474907a7fc7b93b

Contents?: true

Size: 515 Bytes

Versions: 6

Compression:

Stored size: 515 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(left)
        write(MAP.fetch(node.type))
        visit(right)
      end
    end # FlipFLop
  end # Emitter
end # Unparser

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
unparser-0.0.15 lib/unparser/emitter/flipflop.rb
unparser-0.0.14 lib/unparser/emitter/flipflop.rb
unparser-0.0.13 lib/unparser/emitter/flipflop.rb
unparser-0.0.12 lib/unparser/emitter/flipflop.rb
unparser-0.0.11 lib/unparser/emitter/flipflop.rb
unparser-0.0.10 lib/unparser/emitter/flipflop.rb