Skip to content

Commit 3011525

Browse files
committed
Add field documentation for ArrayPatternNode
1 parent 8db52df commit 3011525

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

config.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,16 +903,64 @@ nodes:
903903
fields:
904904
- name: constant
905905
type: node?
906+
kind:
907+
- ConstantPathNode
908+
- ConstantReadNode
909+
comment: |
910+
Represents the optional constant preceding the Array
911+
912+
foo in Bar[]
913+
^^^
914+
915+
foo in Bar[1, 2, 3]
916+
^^^
917+
918+
foo in Bar::Baz[1, 2, 3]
919+
^^^^^^^^
906920
- name: requireds
907921
type: node[]
922+
comment: |
923+
This represents all the entries in case there is no wildcard, or the entries up to the wildcard in case there is a single wildcard.
924+
925+
foo in 1, 2, 3
926+
^^^^^^^
927+
928+
foo in 1, 2, *
929+
^^^^
908930
- name: rest
909931
type: node?
932+
comment: |
933+
This represents the wildcard, which can be unnamed.
934+
935+
foo in 1, 2, *
936+
^
937+
938+
foo in 1, 2, *a, 3
939+
^^
910940
- name: posts
911941
type: node[]
942+
comment: |
943+
This represents all the entries after the wildcard. This list will be empty if there is no wildcard, or the
944+
945+
foo in *, 1, 2, 3
946+
^^^^^^^
947+
948+
foo in 1, 2, *, 3, 4
949+
^^^^
912950
- name: opening_loc
913951
type: location?
952+
comment: |
953+
The location of the opening brace.
954+
955+
foo = [1, 2]
956+
^
914957
- name: closing_loc
915958
type: location?
959+
comment: |
960+
The location of the closing brace.
961+
962+
foo = [1, 2]
963+
^
916964
comment: |
917965
Represents an array pattern in pattern matching.
918966

0 commit comments

Comments
 (0)