1 parent
d8072564c2
commit
ab1a68144d
3 files changed
+855
-816
No files matched your search
+844
-816
File diff suppressed because it is too large.
Load diff
@@ -710,6 +710,12 @@ Term '[' ']' '?' {
|
||||
Term '[' ']' %prec NONOPT {
|
||||
$$ = block_join($1, gen_op_simple(EACH));
|
||||
} |
|
||||
Term '.' '[' ']' '?' {
|
||||
$$ = block_join($1, gen_op_simple(EACH_OPT));
|
||||
} |
|
||||
Term '.' '[' ']' %prec NONOPT {
|
||||
$$ = block_join($1, gen_op_simple(EACH));
|
||||
} |
|
||||
Term '[' Exp ':' Exp ']' '?' {
|
||||
$$ = gen_slice_index($1, $3, $5, INDEX_OPT);
|
||||
} |
|
||||
|
||||
@@ -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
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user