class Prism::MultiWriteNode
^^^^^^^^^^^^^^^^^
a, b, c = 1, 2, 3
Represents a write to a multi-target expression.
def self.type
def self.type :multi_write_node end
def ===(other)
Implements case-equality for the node. This is effectively == but without
def ===(other) other.is_a?(MultiWriteNode) && (lefts.length == other.lefts.length) && lefts.zip(other.lefts).all? { |left, right| left === right } && (rest === other.rest) && (rights.length == other.rights.length) && rights.zip(other.rights).all? { |left, right| left === right } && (lparen_loc.nil? == other.lparen_loc.nil?) && (rparen_loc.nil? == other.rparen_loc.nil?) && (operator_loc.nil? == other.operator_loc.nil?) && (value === other.value) end
def accept(visitor)
def accept(visitor) visitor.visit_multi_write_node(self) end
def child_nodes
def child_nodes [*lefts, rest, *rights, value] end
def comment_targets
def comment_targets [*lefts, *rest, *rights, *lparen_loc, *rparen_loc, operator_loc, value] #: Array[Prism::node | Location] end
def compact_child_nodes
def compact_child_nodes compact = [] #: Array[Prism::node] compact.concat(lefts) compact << rest if rest compact.concat(rights) compact << value compact end
def copy(node_id: self.node_id, location: self.location, flags: self.flags, lefts: self.lefts, rest: self.rest, rights: self.rights, lparen_loc: self.lparen_loc, rparen_loc: self.rparen_loc, operator_loc: self.operator_loc, value: self.value)
def copy(node_id: self.node_id, location: self.location, flags: self.flags, lefts: self.lefts, rest: self.rest, rights: self.rights, lparen_loc: self.lparen_loc, rparen_loc: self.rparen_loc, operator_loc: self.operator_loc, value: self.value) MultiWriteNode.new(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value) end
def deconstruct_keys(keys)
def deconstruct_keys(keys) { node_id: node_id, location: location, lefts: lefts, rest: rest, rights: rights, lparen_loc: lparen_loc, rparen_loc: rparen_loc, operator_loc: operator_loc, value: value } end
def initialize(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value)
def initialize(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value) @source = source @node_id = node_id @location = location @flags = flags @lefts = lefts @rest = rest @rights = rights @lparen_loc = lparen_loc @rparen_loc = rparen_loc @operator_loc = operator_loc @value = value end
def inspect
def inspect InspectVisitor.compose(self) end
def lparen
def lparen lparen_loc&.slice end
def lparen_loc
(a, b, c) = 1, 2, 3
The location of the opening parenthesis.
def lparen_loc location = @lparen_loc case location when nil nil when Location location else @lparen_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end end
def operator
def operator operator_loc.slice end
def operator_loc
a, b, c = 1, 2, 3
The location of the operator.
def operator_loc location = @operator_loc return location if location.is_a?(Location) @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end
def rparen
def rparen rparen_loc&.slice end
def rparen_loc
(a, b, c) = 1, 2, 3
The location of the closing parenthesis.
def rparen_loc location = @rparen_loc case location when nil nil when Location location else @rparen_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end end
def type
def type :multi_write_node end