Sha256: b75456667f81891ee9ffa03c62be7a13d804fb8235819601423369f5a55d36f2

Contents?: true

Size: 647 Bytes

Versions: 4

Compression:

Stored size: 647 Bytes

Contents

module Unparser
  class Emitter
    class Literal
      # Abstract base class for literal range emitter
      class Range < self

        TOKENS = IceNine.deep_freeze(
          :irange => '..',
          :erange => '...'
        )

        handle(*TOKENS.keys)

        children :begin_node, :end_node

      private

        # Perform dispatch
        #
        # @return [undefined]
        #
        # @api private
        #
        def dispatch
          visit_terminated(begin_node)
          write(TOKENS.fetch(node.type))
          visit_terminated(end_node)
        end

      end # Range
    end # Literal
  end # Emitter
end # Unparser

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
unparser-0.1.3 lib/unparser/emitter/literal/range.rb
unparser-0.1.2 lib/unparser/emitter/literal/range.rb
unparser-0.1.1 lib/unparser/emitter/literal/range.rb
unparser-0.1.0 lib/unparser/emitter/literal/range.rb