Class Nodes.MultiWriteNode

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

public static final class Nodes.MultiWriteNode extends Nodes.Node
 Represents a write to a multi-target expression.

     a, b, c = 1, 2, 3
     ^^^^^^^^^^^^^^^^^
 
  • Field Details

    • lefts

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

      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
                 ^^^^
       
    • value

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

  • Method Details