summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-01-01Fix warning in util.cjq-1.5rc1Nicolas Williams
2015-01-01Include missing EXTRA_DIST items; fix #661Nicolas Williams
2015-01-01Add mkstemp() for mingw buildNicolas Williams
2015-01-01Fix memleak introduced run-tests enhancementNicolas Williams
2015-01-01Add more missing test filesNicolas Williams
2015-01-01Add missing test fileNicolas Williams
2014-12-31Move some module tests into all.testNicolas Williams
2014-12-31Further module system revamp (fix #659)Nicolas Williams
To import a module now use: # Import module.jq file: import "relative/path/to/module" as foo; # Use the module's defs as foo::<def-name> To import a JSON file: # Read file.json: import "relative/path/to/file" as $foo; # # Use as $foo::foo Using `-L` now drops the builtin library path and appends the requested path to the empty array (or the result of an earlier `-L`). Support for the `$JQ_LIBRARY_PATH` environment variable has been removed.
2014-12-30Add `label $name | EXP`; fix `break`Nicolas Williams
This is to fix the problem where `break` is dynamic, not lexical. With this it should be possible to do this sort of thing: label $break | inputs | if ... then $break|error else . end This is a backwards-incompatible change for master, but the previous `break` hadn't shipped yet. Still needed: - testing
2014-12-30Remove string indexing by string (fix #454)Nicolas Williams
This turns out to have been a bad idea: "foo"|.["o"] it interacts badly with `path()`. See #454 for the gory details.
2014-12-30Fix parser leak (fuzzing)Nicolas Williams
2014-12-30Fix lineno counting in jq_test.cNicolas Williams
2014-12-30Add support for testing erroneous programsNicolas Williams
This will allow moving tests of some tests from tests/run to tests/all.test. It will also be useful for more extensive testing of language features where we want nice error messages, or errors at all, to be produced, particularly language features where the errors arise at compile-, codegen-, or link-time rather than parse-time. This does not check for run-time errors though -- those we can already check for with try/catch. $ jq --run-tests %%FAIL break jq: error: break used outside labeled control structure ^D 1 of 1 tests passed (0 malformed) $
2014-12-30Make --run-tests more informativeNicolas Williams
Print the line number and program text on the same output line where a failure is reported, for all failures that were already reported on lines starting with '***'. This makes poring over test logs with failures much easier.
2014-12-30Allow resetting of jq err callbackNicolas Williams
This will be useful for the upcoming test-erroneous-programs improvement to --run-tests, so we can switch between the default error reporting method (print to stderr) to a method internal to --run-tests, and back. The idea is that when testing programs that are expected to compile (and link), it'd be nice if errors continue going to stderr, while when testing programs that must fail to compile (or link), the error has to be captured so it can be compared to the error expected by the test.
2014-12-30Fix streaming bug (fuzzing)Nicolas Williams
2014-12-27transpose/0 for possibly jagged matricespkoppstein
2014-12-27bsearch(x) (binary search): builtin.c (tested), with documentation and test ↵pkoppstein
case. Always yields an integer (even if input is unsorted); returns (-1 - ix) if x is not in input array.
2014-12-27ascii_upcase/0 and ascii_downcase/0pkoppstein
2014-12-27Add `debug` builtinNicolas Williams
And refactor setup of jv dump flags.
2014-12-27Don't force C API users to set input cbNicolas Williams
2014-12-27Make jq --run-tests show test line numbersNicolas Williams
2014-12-27Fix uninitialized struct fieldNicolas Williams
2014-12-26Streaming parser torture testsNicolas Williams
2014-12-26Fuzz JSON parserNicolas Williams
2014-12-26Better quoting in tests/runNicolas Williams
2014-12-26Add Streaming parser (--stream)Nicolas Williams
Streaming means that outputs are produced as soon as possible. With the `foreach` syntax one can write programs which reduce portions of the streaming parse of a large input (reduce into proper JSON values, for example), and discard the rest, processing incrementally. This: $ jq -c --stream . should produce the same output as this: $ jq -c '. as $dot | path(..) as $p | $dot | getpath($p) | [$p,.]' The output of `jq --stream .` should be a sequence of`[[<path>],<leaf>]` and `[[<path>]]` values. The latter indicate that the array/object at that path ended. Scalars and empty arrays and objects are leaf values for this purpose. For example, a truncated input produces a path as soon as possible, then later the error: $ printf '[0,\n'|./jq -c --stream . [[0],0] parse error: Unfinished JSON term at EOF at line 3, column 0 $
2014-12-26Allow C-coded functions to `empty`Nicolas Williams
Just return a jv_invalid() without a message.
2014-12-26Add BLOCK_8() macroNicolas Williams
2014-12-26Fix `foreach` non-progation of errorsNicolas Williams
Errors were being re-propagated as "break". Also add `error/0` builtin, which made this fix easier.
2014-12-26Allow zero-length buffers in jv_parser_set_buf()Nicolas Williams
If the caller is at EOF and has no more bytes to feed the parser, how is the parser to be told about the EOF condition? A small fix to allow zero-length buffers in jv_parser_set_buf() fixes this problem (it also makes it easier to deal with async I/O: feed the parser whatever is available, including nothing).
2014-12-26Fix in and insideNicolas Williams
2014-12-26Merge pull request #624 from Janrain-Colin/patch-1Nico Williams
Doc correction
2014-12-26Merge pull request #366 from slapresta/inversed-containsNico Williams
Added `in` command
2014-12-26Merge pull request #628 from slapresta/map-on-objectsNico Williams
Modify map\1 so that it works on objects
2014-12-24Fix infinite loop in read_more() (fix #656)Nicolas Williams
2014-12-24Fix EOF handling; fix #656Nicolas Williams
2014-12-24Merge pull request #651 from eiiches/fix-examplesNico Williams
Fix several errors in the manual
2014-12-24Add @tsv; fix #645Nicolas Williams
2014-12-24Merge pull request #653 from msabramo/patch-1Nico Williams
.travis.yml: Set sudo false; use containers
2014-12-24Module search revamp for pkg managersNicolas Williams
The search path listed in an import directive can now be an array. The top-level search path is appended. Null and empty strings in the path terminate any search. The "." in "." and "./*" is replaced with the directory containing the file doing the import (for command-line programs this is the current directory, though that may be a bad idea). No version numbers or anything of the sort are gratuitously added to the search paths. All this makes external package managers possible by allowing dependencies to be installed local to dependents.
2014-12-24Fix bug caused by 8ca07a0Nicolas Williams
2014-12-24Fix #348: reject unescaped control charsNicolas Williams
2014-12-23Merge pull request #601 from slapresta/redefine-any-allNico Williams
Define {any,all}/0,1 in terms of {any,all}/2
2014-12-23Use __attribute__ __printf__ with GCCNicolas Williams
2014-12-23Make `values` faster (fix #652)Nicolas Williams
2014-12-23Fix #649Nicolas Williams
2014-12-22.travis.yml: Set sudo false; use containersMarc Abramowitz
This is the way to enable Travis's fancy new containers, which should result in faster builds.
2014-12-22Define `map_values`Santiago Lapresta
2014-12-22`in` is now `inside`, added `in` as inverse of `has`Santiago Lapresta