Package org.prism
Class Nodes.MultiTargetNode
java.lang.Object
org.prism.Nodes.Node
org.prism.Nodes.MultiTargetNode
- Enclosing class:
- Nodes
Represents a multi-target expression. a, (b, c) = 1, 2, 3 ^^^^^^ This can be a part of `MultiWriteNode` as above, or the target of a `for` loop for a, b in [[1, 2], [3, 4]] ^^^^
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Nodes.Node[]
Represents the targets expressions before a splat node.final Nodes.Node
Represents a splat node in the target expression.final Nodes.Node[]
Represents the targets expressions after a splat node.Fields inherited from class org.prism.Nodes.Node
EMPTY_ARRAY, length, nodeId, startOffset
-
Constructor Summary
ConstructorsConstructorDescriptionMultiTargetNode
(int nodeId, int startOffset, int length, Nodes.Node[] lefts, Nodes.Node rest, Nodes.Node[] rights) -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(AbstractNodeVisitor<T> visitor) protected String
<T> void
visitChildNodes
(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, c, *) = 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 ^^^^
-
-
Constructor Details
-
MultiTargetNode
public MultiTargetNode(int nodeId, int startOffset, int length, Nodes.Node[] lefts, Nodes.Node rest, Nodes.Node[] rights)
-
-
Method Details
-
visitChildNodes
- Specified by:
visitChildNodes
in classNodes.Node
-
childNodes
- Specified by:
childNodes
in classNodes.Node
-
accept
- Specified by:
accept
in classNodes.Node
-
toString
- Specified by:
toString
in classNodes.Node
-