diff options
author | Nicolas Williams <nico@cryptonector.com> | 2014-07-06 03:24:29 -0500 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2014-07-06 19:40:05 -0500 |
commit | 5a863bf0103ccd82edf32cfe4c37ed92783a224d (patch) | |
tree | 0667cff3dac30300a92f31d16e8b26950df6d1b3 /builtin.c | |
parent | d0ca11d6652cc8aeb0ea4fc674f427f81dcf1467 (diff) |
Add `foreach` and `limit`
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -963,6 +963,7 @@ static const char* const jq_builtins[] = { " def _while: " " if cond then ., (update | _while) else empty end; " " _while;", + "def limit(n; exp): if n < 0 then exp else foreach exp as $item ([n, null]; if .[0] < 1 then empty else [.[0] -1, $item] end; .[1]) end;", }; #undef LIBM_DD |