Sha256: 53a61e01185ed7eed1cd1b3a67e11e2b576cc1f16701283c84900e790196e691

Contents?: true

Size: 452 Bytes

Versions: 12

Compression:

Stored size: 452 Bytes

Contents

# frozen_string_literal: true

module Unparser
  class Emitter
    # Emiter for match rest nodes
    class MatchRest < self
      children :match_var

      def emit_array_pattern
        write('*')
        emit_match_var
      end

      def emit_hash_pattern
        write('**')
        emit_match_var
      end

    private

      def emit_match_var
        visit(match_var) if match_var
      end
    end # MatchRest
  end # Emitter
end # Unparser

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
unparser-0.6.3 lib/unparser/emitter/match_rest.rb
unparser-0.6.2 lib/unparser/emitter/match_rest.rb
unparser-0.6.1 lib/unparser/emitter/match_rest.rb
unparser-0.6.0 lib/unparser/emitter/match_rest.rb
unparser-0.5.7 lib/unparser/emitter/match_rest.rb
unparser-0.5.6 lib/unparser/emitter/match_rest.rb
unparser-0.5.5 lib/unparser/emitter/match_rest.rb
unparser-0.5.4 lib/unparser/emitter/match_rest.rb
unparser-0.5.3 lib/unparser/emitter/match_rest.rb
unparser-0.5.2 lib/unparser/emitter/match_rest.rb
unparser-0.5.1 lib/unparser/emitter/match_rest.rb
unparser-0.5.0 lib/unparser/emitter/match_rest.rb