Sha256: ebf9ac5aff43cf3c9d3eb84295a7273d5bea638f77a39cbb77969e14de331315
Contents?: true
Size: 797 Bytes
Versions: 24
Compression:
Stored size: 797 Bytes
Contents
# frozen_string_literal: true module Unparser class Emitter # Emitter for multiple assignment left hand side class MLHS < self handle :mlhs NO_COMMA = %i[arg splat mlhs restarg].freeze private_constant(*constants(false)) private def dispatch if children.one? emit_one_child_mlhs else emit_many end end def emit_one_child_mlhs child = children.first parentheses do emitter(child).emit_mlhs write(',') unless NO_COMMA.include?(child.type) end end def emit_many parentheses do delimited(children) do |node| emitter(node).emit_mlhs end end end end # MLHS end # Emitter end # Unaprser
Version data entries
24 entries across 24 versions & 2 rubygems