summaryrefslogtreecommitdiffstats
path: root/builtin.c
AgeCommit message (Collapse)Author
2014-07-07`error(x)` should not `tostring` its arg; fix #466Nicolas Williams
2014-07-07`limit` should use `break`Nicolas Williams
2014-07-07Make `any/2` and `all/2` efficient using `foreach`Nicolas Williams
2014-07-07Add `break` builtin for `foreach`Nicolas Williams
2014-07-06Add `any/N` and `all/N` x N in (1, 2) (fix #455)Nicolas Williams
Contributed by @pkoppstein.
2014-07-06Add `foreach` and `limit`Nicolas Williams
2014-07-02Add `while(cond; update)` (fix #314)Nicolas Williams
2014-07-02Add `range(init;upto;by)` (fix #317)Nicolas Williams
2014-07-01Fixed base64 issue with UTF-8 stringsWilliam Langford
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2014-06-30Let @uri produce uppercase hexadecimal digits...Zhiming Wang
instead of lowercase ones. According to RFC 3986, The uppercase hexadecimal digits 'A' through 'F' are equivalent to the lowercase digits 'a' through 'f', respectively. If two URIs differ only in the case of hexadecimal digits used in percent-encoded octets, they are equivalent. For consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent- encodings. See https://github.com/stedolan/jq/issues/451 for details. Test suite and manual are also updated to reflect this change. Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2014-06-18Remove extra free of testmodeNicolas Williams
I added a jv_free() too many while rebasing @wtlangford's contribution. It could only be triggered by calling `_match_impl` directly.
2014-06-18Added regex support as per issue #164.William Langford
jq now depends on oniguruma for regex support. Modified configure.ac accordingly. Added valgrind suppression file for oniguruma to prevent one-time and bounded leaks from causing tests to fail. Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2014-06-17Simplified standard librarySantiago Lapresta
Close #426. Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2014-06-16Fix #280: from_entries of [] is null, should be {}Nicolas Williams
2014-06-16Don't declare environ on WIN32Nicolas Williams
2014-06-16Added `flatten` and `flatten(x)` functionsSantiago Lapresta
Fix #415.
2014-06-13Add `env` builtinNicolas Williams
2014-06-08Add `indices(s)`, improve `index(s)`, `rindex(s)`Nicolas Williams
Now these deal with arrays as input and `s` being an array or a scalar.
2014-06-07Added `join` functionSantiago Lapresta
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2014-06-07String * number should be commutativeNicolas Williams
2014-05-12Added unique_by functionSantiago Lapresta
2014-03-13Also add `scalars`Nicolas Williams
2014-03-13Added `arrays` and other filtersSantiago Lapresta
Arrays, objects, numbers, strings, booleans, nulls, values (non-nulls) -- these builtins filter out those inputs that don't match the name of the builtin. This fixes #322 and #324.
2014-03-08Add a recursive object merge strategy and bind it to *Filippo Valsorda
This commit adds a jv_object_merge_recursive function, that performs recursive object merging, and binds it to multiply when applied to two objects. Added docs and tests. Closes #320
2014-02-21Initial add of math functions.Mike McCabe
2014-02-20Add `?`, `.[]?`, and `..` operatorsNicolas Williams
Make XPath-like `//a/b` recursive structure traversal easier in jq, which then becomes: ..|.a?.b? The `?` operator suppresses errors about . not being an array or object. The `..` operator is equivalent to calling the new `recurse_down` built-in, which in turn is equivalent to recurse(.[]?) Note that `..a` is not supported; neither is `...a`. That could be add added, but it doesn't seem worth the trouble of saving the need to type a '|'.
2014-02-17Added `all` and `any` builtinsSantiago Lapresta
2014-02-05Fix cut-n-paste in `leaf_paths`; doc and test 'emNicolas Williams
2014-02-05#285 add and builtinsNicolas Williams
2013-12-04Add index and rindex builtinsNicolas Williams
2013-12-04Make length return abs value of numeric inputsNicolas Williams
2013-12-04Add callback interface for errorsNicolas Williams
Printing to stderr is not the right answer for a library.
2013-12-04Add ltrimstr and rtrimstr functionsNicolas Williams
2013-12-04Add tojson and fromjson builtinsNicolas Williams
2013-12-04Add string division by string (split on separator)Nicolas Williams
2013-12-04Add string multiplication by numberNicolas Williams
2013-12-04Add startswith/endswithNicolas Williams
2013-12-04Add explode/implode jq functions to match jv APINicolas Williams
2013-09-14Merge pull request #182 from mdaines/sqrt-builtinStephen Dolan
Add builtin for calculating square root
2013-09-14Merge branch 'libjq'Stephen Dolan
Conflicts: Makefile.am configure.ac
2013-09-11Add sqrt operatorMichael Daines
2013-06-23Remove #includes from jv.hlibjqStephen Dolan
2013-06-22Merge branch 'header-cleanup' into libjqStephen Dolan
Conflicts: Makefile.am
2013-06-21Add floor operatorNicolas Williams
2013-06-21Add mod (and setmod) operatorsNicolas Williams
2013-06-21Add libjq autoconf gooNicolas Williams
2013-06-21Move cfunction invocation code to the interpreter loop.header-cleanupStephen Dolan
2013-06-18Simplify block functions for variablesStephen Dolan
2013-06-15Move slurp_file() into library as jv_load_file()Nicolas Williams
Needed as part of creating a libjq.
2013-05-29Load library from ~/.jqBrendan Macmillan