Skip to content

Commit b6a97a4

Browse files
herwinwkddnewton
authored andcommitted
Document MultiWriteNode fields
1 parent b817cd2 commit b6a97a4

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

config.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3003,8 +3003,36 @@ nodes:
30033003
- CallTargetNode
30043004
- IndexTargetNode
30053005
- MultiTargetNode
3006+
comment: |
3007+
Represents the targets expressions before a splat node.
3008+
3009+
a, b, * = 1, 2, 3, 4, 5
3010+
^^^^
3011+
3012+
The splat node can be absent, in that case all target expressions are in the left field.
3013+
3014+
a, b, c = 1, 2, 3, 4, 5
3015+
^^^^^^^
30063016
- name: rest
30073017
type: node?
3018+
kind:
3019+
- ImplicitRestNode
3020+
- SplatNode
3021+
comment: |
3022+
Represents a splat node in the target expression.
3023+
3024+
a, b, *c = 1, 2, 3, 4
3025+
^^
3026+
3027+
The variable can be empty, this results in a `SplatNode` with a `nil` expression field.
3028+
3029+
a, b, * = 1, 2, 3, 4
3030+
^
3031+
3032+
If the `*` is omitted, the field will containt an `ImplicitRestNode`
3033+
3034+
a, b, = 1, 2, 3, 4
3035+
^
30083036
- name: rights
30093037
type: node[]
30103038
kind:
@@ -3017,14 +3045,39 @@ nodes:
30173045
- CallTargetNode
30183046
- IndexTargetNode
30193047
- MultiTargetNode
3048+
comment: |
3049+
Represents the targets expressions after a splat node.
3050+
3051+
a, *, b, c = 1, 2, 3, 4, 5
3052+
^^^^
30203053
- name: lparen_loc
30213054
type: location?
3055+
comment: |
3056+
The location of the opening parenthesis.
3057+
3058+
(a, b, c) = 1, 2, 3
3059+
^
30223060
- name: rparen_loc
30233061
type: location?
3062+
comment: |
3063+
The location of the closing parenthesis.
3064+
3065+
(a, b, c) = 1, 2, 3
3066+
^
30243067
- name: operator_loc
30253068
type: location
3069+
comment: |
3070+
The location of the operator.
3071+
3072+
a, b, c = 1, 2, 3
3073+
^
30263074
- name: value
30273075
type: node
3076+
comment: |
3077+
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).
3078+
3079+
a, b, c = 1, 2, 3
3080+
^^^^^^^
30283081
comment: |
30293082
Represents a write to a multi-target expression.
30303083

0 commit comments

Comments
 (0)