Ruby: pm_multi_target_node Struct Reference

Ruby 3.4.8p72 (2025-12-17 revision 995b59f66677d44767ce9faac6957e5543617ff9)

Data Fields
pm_multi_target_node Struct Reference

MultiTargetNode. More...

`#include <ast.h>`

## Data Fields
pm_node_t | base
| The embedded base node.
struct pm_node_list | lefts
| MultiTargetNode#lefts.
struct pm_node * | rest
| MultiTargetNode#rest.
struct pm_node_list | rights
| MultiTargetNode#rights.
pm_location_t | lparen_loc
| MultiTargetNode#lparen_loc.
pm_location_t | rparen_loc
| MultiTargetNode#rparen_loc.
Data Fields inherited from pm_node
pm_node_type_t | type
| This represents the type of the node.
pm_node_flags_t | flags
| This represents any flags on the node.
uint32_t | node_id
| The unique identifier for this node, which is deterministic based on the source.
pm_location_t | location
| This is the location of the node in the source.

## Detailed Description

MultiTargetNode.

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]]
        ^^^^

Type: ::PM_MULTI_TARGET_NODE

Definition at line 6136 of file ast.h.

## Field Documentation

## ◆ base

pm_node_t pm_multi_target_node::base

The embedded base node.

Definition at line 6138 of file ast.h.

Referenced by pm_dump_json().

## ◆ lefts

struct pm_node_list pm_multi_target_node::lefts

MultiTargetNode#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
        ^^^^

Definition at line 6154 of file ast.h.

Referenced by pm_dump_json(), pm_node_destroy(), and pm_visit_child_nodes().

## ◆ lparen_loc

pm_location_t pm_multi_target_node::lparen_loc

MultiTargetNode#lparen_loc.

The location of the opening parenthesis.

    a, (b, c) = 1, 2, 3
       ^

Definition at line 6194 of file ast.h.

Referenced by pm_dump_json().

## ◆ rest

struct pm_node* pm_multi_target_node::rest

MultiTargetNode#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
         ^

Definition at line 6174 of file ast.h.

Referenced by pm_dump_json(), pm_node_destroy(), and pm_visit_child_nodes().

## ◆ rights

struct pm_node_list pm_multi_target_node::rights

MultiTargetNode#rights.

Represents the targets expressions after a splat node.

    a, (*, b, c) = 1, 2, 3, 4, 5
           ^^^^

Definition at line 6184 of file ast.h.

Referenced by pm_dump_json(), pm_node_destroy(), and pm_visit_child_nodes().

## ◆ rparen_loc

pm_location_t pm_multi_target_node::rparen_loc

MultiTargetNode#rparen_loc.

The location of the closing parenthesis.

    a, (b, c) = 1, 2, 3
            ^

Definition at line 6204 of file ast.h.

Referenced by pm_dump_json().

The documentation for this struct was generated from the following file:

- prism/ast.h