diff options
author | Nicolas Williams <nico@cryptonector.com> | 2014-12-26 22:49:32 -0600 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2014-12-26 22:56:48 -0600 |
commit | c02fcc8fef377b5470adea771385a70bbdd72686 (patch) | |
tree | f5f218e4d6ca0658e152426b2172a84b051739cb | |
parent | 25d4cbd1b31148ae720c55c35685a9ed911b6a4c (diff) |
Fix in and inside
-rw-r--r-- | builtin.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1121,8 +1121,14 @@ static const char* const jq_builtins[] = { " | reduce range(0; $max) as $j" " ([]; . + [reduce range(0;$length) as $i ([]; . + [ $in[$i][$j] ] )] )" " end;", - "def in(xs): . as $x | xs | has($x)", - "def inside(xs): . as $x | xs | contains($x)", + "def in(xs): . as $x | xs | has($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 |