Sha256: 8dc5a3788433d689caaaf830a25ff92a5a694104cadae62fddeac8c6eb19f559

Contents?: true

Size: 847 Bytes

Versions: 8

Compression:

Stored size: 847 Bytes

Contents

# frozen_string_literal: true

module Unparser
  class Emitter
    # Emitter for simple nodes that generate a single token
    class Simple < self
      MAP = IceNine.deep_freeze(
        __ENCODING__:      '__ENCODING__',
        __FILE__:          '__FILE__',
        __LINE__:          '__LINE__',
        false:             'false',
        forward_arg:       '...',
        forwarded_args:    '...',
        kwnilarg:          '**nil',
        match_nil_pattern: '**nil',
        nil:               'nil',
        redo:              'redo',
        retry:             'retry',
        self:              'self',
        true:              'true',
        zsuper:            'super'
      )

      handle(*MAP.keys)

    private

      def dispatch
        write(MAP.fetch(node_type))
      end
    end # Simple
  end # Emitter
end # Unparser

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
unparser-0.5.7 lib/unparser/emitter/simple.rb
unparser-0.5.6 lib/unparser/emitter/simple.rb
unparser-0.5.5 lib/unparser/emitter/simple.rb
unparser-0.5.4 lib/unparser/emitter/simple.rb
unparser-0.5.3 lib/unparser/emitter/simple.rb
unparser-0.5.2 lib/unparser/emitter/simple.rb
unparser-0.5.1 lib/unparser/emitter/simple.rb
unparser-0.5.0 lib/unparser/emitter/simple.rb