summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorydah <t.yudai92@gmail.com>2024-11-28 22:49:16 +0900
committergit <svn-admin@ruby-lang.org>2024-12-02 18:36:42 +0000
commit76aa9fd1125f54dd60577fbc304f6eb93228fff5 (patch)
tree0fcb579a7b6598c09d3c71ba7d612c6e32d2be7c
parent4574ac5f79fac964806e463737b994780e735aa8 (diff)
[ruby/prism] Add document ArrayPatternNode fields
Partially fixes: https://github.com/ruby/prism/issues/2123 https://github.com/ruby/prism/commit/396c6d4340
-rw-r--r--prism/config.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/prism/config.yml b/prism/config.yml
index 3e2da284b0..2f24a24c0b 100644
--- a/prism/config.yml
+++ b/prism/config.yml
@@ -987,16 +987,41 @@ nodes:
- name: requireds
type: node[]
kind: pattern expression
+ comment: |
+ Represents the required elements of the array pattern.
+
+ foo in [1, 2]
+ ^ ^
- name: rest
type: node?
kind: pattern expression
+ comment: |
+ Represents the rest element of the array pattern.
+
+ foo in *bar
+ ^^^^
- name: posts
type: node[]
kind: pattern expression
+ comment: |
+ Represents the elements after the rest element of the array pattern.
+
+ foo in *bar, baz
+ ^^^
- name: opening_loc
type: location?
+ comment: |
+ Represents the opening location of the array pattern.
+
+ foo in [1, 2]
+ ^
- name: closing_loc
type: location?
+ comment: |
+ Represents the closing location of the array pattern.
+
+ foo in [1, 2]
+ ^
comment: |
Represents an array pattern in pattern matching.