Support .a.[] and .a.[]? each syntax

Fixes #1699
This commit is contained in:
Mattias Wadman authored and Nico Williams committed 2023-07-09 10:08:31 -05:00
1 parent d8072564c2
commit ab1a68144d
3 files changed
+855 -816

No files matched your search

+5
View File
@@ -173,6 +173,11 @@ jq: error: Cannot use number (0) as object key at <top-level>, line 1:
[1,null,true,false,"abcdef",{},{"a":1,"b":2},[],[1,2,3,4,5],[1,2]]
[null,"bc",[],[2,3],[2]]
# chaining/suffix-list, with and without dot
map(try .a[] catch ., try .a.[] catch ., .a[]?, .a.[]?)
[{"a": [1,2]}, {"a": 123}]
[1,2,1,2,1,2,1,2,"Cannot iterate over number (123)","Cannot iterate over number (123)"]
#
# Negative array indices
#