Add foreach and limit

This commit is contained in:
Nicolas Williams committed 2014-07-06 19:40:05 -05:00
1 parent d0ca11d665
commit 5a863bf010
7 files changed
+88

No files matched your search

+1
View File
@@ -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