Fix in and inside
This commit is contained in:
1 parent
25d4cbd1b3
commit
c02fcc8fef
1 file changed
+8
-2
@@ -1121,8 +1121,14 @@ static const char* const jq_builtins[] = {
|
|||||||
" | reduce range(0; $max) as $j"
|
" | reduce range(0; $max) as $j"
|
||||||
" ([]; . + [reduce range(0;$length) as $i ([]; . + [ $in[$i][$j] ] )] )"
|
" ([]; . + [reduce range(0;$length) as $i ([]; . + [ $in[$i][$j] ] )] )"
|
||||||
" end;",
|
" end;",
|
||||||
"def in(xs): . as $x | xs | has($x)",
|
"def in(xs): . as $x | xs | has($x);",
|
||||||
"def inside(xs): . as $x | xs | contains($x)",
|
"def inside(xs): . as $x | xs | contains($x);",
|
||||||
|
"def input: try _input catch if .==\"break\" then empty else . end;",
|
||||||
|
"def repeat(exp): "
|
||||||
|
" def _repeat: "
|
||||||
|
" exp, _repeat;"
|
||||||
|
" try _repeat catch if .==\"break\" then empty else . end;",
|
||||||
|
"def inputs: repeat(_input);",
|
||||||
};
|
};
|
||||||
#undef LIBM_DD
|
#undef LIBM_DD
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user