Class Nodes.MultiWriteNode
java.lang.Object
org.prism.Nodes.Node
org.prism.Nodes.MultiWriteNode
- Enclosing class:
Nodes
Represents a write to a multi-target expression.
a, b, c = 1, 2, 3
^^^^^^^^^^^^^^^^^
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Nodes.Node[]Represents the targets expressions before a splat node.final Nodes.NodeRepresents a splat node in the target expression.final Nodes.Node[]Represents the targets expressions after a splat node.final Nodes.NodeThe value to write to the targets.Fields inherited from class org.prism.Nodes.Node
EMPTY_ARRAY, length, startOffset -
Constructor Summary
ConstructorsConstructorDescriptionMultiWriteNode(int startOffset, int length, Nodes.Node[] lefts, Nodes.Node rest, Nodes.Node[] rights, Nodes.Node value) -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(AbstractNodeVisitor<T> visitor) protected String<T> voidvisitChildNodes(AbstractNodeVisitor<T> visitor) Methods inherited from class org.prism.Nodes.Node
endOffset, hasNewLineFlag, setNewLineFlag, setNewLineFlag, toString
-
Field Details
-
lefts
Represents the targets expressions before a splat node. a, b, * = 1, 2, 3, 4, 5 ^^^^ The splat node can be absent, in that case all target expressions are in the left field. a, b, c = 1, 2, 3, 4, 5 ^^^^^^^ -
rest
Represents a splat node in the target expression. a, b, *c = 1, 2, 3, 4 ^^ The variable can be empty, this results in a `SplatNode` with a `nil` expression field. a, b, * = 1, 2, 3, 4 ^ If the `*` is omitted, this field will contain an `ImplicitRestNode` a, b, = 1, 2, 3, 4 ^ -
rights
Represents the targets expressions after a splat node. a, *, b, c = 1, 2, 3, 4, 5 ^^^^ -
value
The value to write to the targets. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). a, b, c = 1, 2, 3 ^^^^^^^
-
-
Constructor Details
-
MultiWriteNode
public MultiWriteNode(int startOffset, int length, Nodes.Node[] lefts, Nodes.Node rest, Nodes.Node[] rights, Nodes.Node value)
-
-
Method Details
-
visitChildNodes
- Specified by:
visitChildNodesin classNodes.Node
-
childNodes
- Specified by:
childNodesin classNodes.Node
-
accept
- Specified by:
acceptin classNodes.Node
-
toString
- Specified by:
toStringin classNodes.Node
-