Ruby  3.4.0dev (2024-11-22 revision 0989400a925cd201defdca9eb28eb87200b30785)
Data Fields
pm_multi_write_node Struct Reference

MultiWriteNode. More...

#include <ast.h>

Data Fields

pm_node_t base
 The embedded base node. More...
 
struct pm_node_list lefts
 MultiWriteNode::lefts. More...
 
struct pm_noderest
 MultiWriteNode::rest. More...
 
struct pm_node_list rights
 MultiWriteNode::rights. More...
 
pm_location_t lparen_loc
 MultiWriteNode::lparen_loc. More...
 
pm_location_t rparen_loc
 MultiWriteNode::rparen_loc. More...
 
pm_location_t operator_loc
 MultiWriteNode::operator_loc. More...
 
struct pm_nodevalue
 MultiWriteNode::value. More...
 
- Data Fields inherited from pm_node
pm_node_type_t type
 This represents the type of the node. More...
 
pm_node_flags_t flags
 This represents any flags on the node. More...
 
uint32_t node_id
 The unique identifier for this node, which is deterministic based on the source. More...
 
pm_location_t location
 This is the location of the node in the source. More...
 

Detailed Description

MultiWriteNode.

Represents a write to a multi-target expression.

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

Type: PM_MULTI_WRITE_NODE

Definition at line 5614 of file ast.h.

Field Documentation

◆ base

pm_node_t pm_multi_write_node::base

The embedded base node.

Definition at line 5616 of file ast.h.

◆ lefts

struct pm_node_list pm_multi_write_node::lefts

MultiWriteNode::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
^^^^^^^

Definition at line 5616 of file ast.h.

Referenced by pm_node_destroy(), and pm_visit_child_nodes().

◆ lparen_loc

pm_location_t pm_multi_write_node::lparen_loc

MultiWriteNode::lparen_loc.

The location of the opening parenthesis.

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

Definition at line 5672 of file ast.h.

◆ operator_loc

pm_location_t pm_multi_write_node::operator_loc

MultiWriteNode::operator_loc.

The location of the operator.

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

Definition at line 5692 of file ast.h.

◆ rest

struct pm_node* pm_multi_write_node::rest

MultiWriteNode::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 5652 of file ast.h.

Referenced by pm_node_destroy(), and pm_visit_child_nodes().

◆ rights

struct pm_node_list pm_multi_write_node::rights

MultiWriteNode::rights.

Represents the targets expressions after a splat node.

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

Definition at line 5652 of file ast.h.

Referenced by pm_node_destroy(), and pm_visit_child_nodes().

◆ rparen_loc

pm_location_t pm_multi_write_node::rparen_loc

MultiWriteNode::rparen_loc.

The location of the closing parenthesis.

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

Definition at line 5682 of file ast.h.

◆ value

struct pm_node* pm_multi_write_node::value

MultiWriteNode::value.

The value to write to the targets. It can be any non-void expression.

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

Definition at line 5702 of file ast.h.

Referenced by pm_node_destroy(), and pm_visit_child_nodes().


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