Sha256: 60d68c7a860704902827c200734de8f42d349f445614d43c3f0dfefebf3dd287

Contents?: true

Size: 624 Bytes

Versions: 14

Compression:

Stored size: 624 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(begin_node)
          write(TOKENS.fetch(node.type))
          visit(end_node)
        end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
unparser-0.0.15 lib/unparser/emitter/literal/range.rb
unparser-0.0.14 lib/unparser/emitter/literal/range.rb
unparser-0.0.13 lib/unparser/emitter/literal/range.rb
unparser-0.0.12 lib/unparser/emitter/literal/range.rb
unparser-0.0.11 lib/unparser/emitter/literal/range.rb
unparser-0.0.10 lib/unparser/emitter/literal/range.rb
unparser-0.0.8 lib/unparser/emitter/literal/range.rb
unparser-0.0.7 lib/unparser/emitter/literal/range.rb
unparser-0.0.6 lib/unparser/emitter/literal/range.rb
unparser-0.0.5 lib/unparser/emitter/literal/range.rb
unparser-0.0.4 lib/unparser/emitter/literal/range.rb
unparser-0.0.3 lib/unparser/emitter/literal/range.rb
unparser-0.0.2 lib/unparser/emitter/literal/range.rb
unparser-0.0.1 lib/unparser/emitter/literal/range.rb