Sha256: cce67b645869a13fd94a8c60d6e61e11996409c18b5e06c1335ab3d8bd69cf2c

Contents?: true

Size: 555 Bytes

Versions: 6

Compression:

Stored size: 555 Bytes

Contents

# encoding: utf-8

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

      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.2.4 lib/unparser/emitter/flipflop.rb
unparser-0.2.3 lib/unparser/emitter/flipflop.rb
unparser-0.2.2 lib/unparser/emitter/flipflop.rb
unparser-0.2.1 lib/unparser/emitter/flipflop.rb
unparser-0.2.0 lib/unparser/emitter/flipflop.rb
unparser-0.1.16 lib/unparser/emitter/flipflop.rb