Sha256: 154641ea82f1de6b3e948d8aabb87a3f4e185efaa7714c72ef87efa0169794d3

Contents?: true

Size: 538 Bytes

Versions: 5

Compression:

Stored size: 538 Bytes

Contents

# frozen_string_literal: true

module Unparser
  class Emitter
    # Emitter for in pattern nodes
    class InPattern < self

      handle :in_pattern

      children :target, :unless_guard, :branch, :else_branch

    private

      def dispatch
        write('in')

        ws

        visit(target)

        if unless_guard
          ws
          visit(unless_guard)
        end

        if branch
          ws
          write('then')
          emit_body(branch)
        end
      end
    end # InPattern
  end # Emitter
end # Unparser

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
unparser-0.5.4 lib/unparser/emitter/in_pattern.rb
unparser-0.5.3 lib/unparser/emitter/in_pattern.rb
unparser-0.5.2 lib/unparser/emitter/in_pattern.rb
unparser-0.5.1 lib/unparser/emitter/in_pattern.rb
unparser-0.5.0 lib/unparser/emitter/in_pattern.rb