Package org.prism

Class Nodes.MultiTargetNode

java.lang.Object
org.prism.Nodes.Node
org.prism.Nodes.MultiTargetNode
Enclosing class:
Nodes

public static final class Nodes.MultiTargetNode extends Nodes.Node
 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 Details

    • lefts

      public final Nodes.Node[] 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

      public final Nodes.Node 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

      public final Nodes.Node[] rights
       Represents the targets expressions after a splat node.
      
           a, (*, b, c) = 1, 2, 3, 4, 5
                  ^^^^
       
  • Constructor Details

  • Method Details