1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

969 Commits

Author SHA1 Message Date
10e8d34fd3 Fix oniguruma detection logic
At the moment, a failed oniguruma header check would leave
HAVE_ONIGURUMA set to 1 still, resulting in a compiler error
in builtin.c.
2015-02-16 09:01:08 +00:00
ebc090ad15 README tweaks 2015-02-15 18:34:44 -06:00
8cef5a37ab Add --disable-maintainer-mode; make bison optional
Also flex is now optional.

The outputs of flex and bison are now committed.  By default they get
built, but users who want to build from git can now

    ./configure --disable-maintainer-mode

to turn off the dependency on bison and flex.

Maintainers must, of course, commit the bison and/or flex outputs when
they make changes to parser.y and/or lexer.l, respectively.
2015-02-15 18:34:44 -06:00
8afdeee785 Make Oniguruma/regexp optional
Tests won't pass if built without Oniguruma.  We don't have a way to
make a test optional yet.  That will come later.  For now the ability to
reduce build-time dependencies could really help some users.
2015-02-15 18:32:01 -06:00
a83a9e0bc2 Reduce number of msg callback typedefs 2015-02-13 15:58:02 -06:00
0d414471bb Refactor moar: move parts of main.c into libjq
This adds utility functions for reading and parsing files that should be
easy to use by other apps, together with jq_start()/jq_next().
2015-02-13 15:58:02 -06:00
91fb3df495 Refactor handling of inputs in main() (fix #667)
Much of this could be in libjq.  Eventually all of the work of reading
from files and looping over `jq_next()` should move into libjq, with
`main()` mostly doing all the command-line option processing.
2015-02-13 15:55:31 -06:00
373ef71feb Merge pull request #692 from kim-toms/enhance-from_entries
Enhance from_entries to better deal with Amazon AWS Tags
2015-02-10 10:49:35 -06:00
ca78a746e6 Enhance from_entries to better deal with Amazon AWS Tags 2015-02-10 08:33:56 -05:00
1e13e1e06e Fix sequence warnings (fix #686) 2015-01-30 17:21:50 -06:00
42ff8a6959 Usage message for -h should go to stdout 2015-01-30 10:27:46 -06:00
2e92c3e568 Merge pull request #678 from isomorphisms/patch-1
readability
2015-01-27 14:15:07 -05:00
i
5389fdb651 readability
Easier to read dashes than hyphens imho.
2015-01-27 13:32:15 -05:00
7a295b30e0 Fix --raw-input 2015-01-20 00:22:24 -06:00
cca3e92854 Merge pull request #669 from joelpurra/join-empty-array-668
Empty arrays join/1 to an empty string, fixes #668 bug introduced by 9760245
2015-01-14 15:50:15 -06:00
4d05dc55a3 Empty arrays join/1 to an empty string, fixes #668 bug introduced by 9760245 2015-01-14 12:27:55 +01:00
aeb52e29d6 Add debug and stderr builtins
And refactor setup of jv dump flags.
2015-01-14 01:39:13 -06:00
97602456e3 join/1: respect empty strings (fix #668) 2015-01-14 01:32:25 -06:00
8b5ff40402 Split on empty sep: fix #552 moar 2015-01-14 01:32:11 -06:00
d630597e87 Fix docs for split/0 2015-01-12 10:47:43 -06:00
60d1ecb58a Fix #552 2015-01-12 10:44:44 -06:00
d927a2c185 Fix --run-tests arg handling 2015-01-12 10:43:06 -06:00
6e7cf81d74 Look for jq/main.jq for imports 2015-01-02 19:16:43 -06:00
736f1751ee Add comments to tests/run 2015-01-02 19:15:57 -06:00
28aab9ca79 Fix tests/run in from-tar-ball case
Drop useless use of scripts/version
2015-01-02 19:15:11 -06:00
972c048149 Add static build instructions (fix #294) 2015-01-01 16:26:55 -06:00
902aa39fce Fix warning in util.c jq-1.5rc1 2015-01-01 15:15:10 -06:00
22f55aa585 Include missing EXTRA_DIST items; fix #661 2015-01-01 15:14:49 -06:00
157c95b988 Add mkstemp() for mingw build 2015-01-01 03:14:55 -06:00
426913f127 Fix memleak introduced run-tests enhancement 2015-01-01 02:12:08 -06:00
c4cc62a053 Add more missing test files 2015-01-01 01:49:40 -06:00
862696a778 Add missing test file 2015-01-01 01:39:50 -06:00
86bc662bd2 Move some module tests into all.test 2014-12-31 20:09:53 -06:00
ae7f8d6ab9 Further module system revamp (fix #659)
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-31 20:09:53 -06:00
7dc34b92af Add label $name | EXP; fix break
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-30 11:42:45 -06:00
cbfc0d6130 Remove string indexing by string (fix #454)
This turns out to have been a bad idea:

    "foo"|.["o"]

it interacts badly with `path()`.

See #454 for the gory details.
2014-12-30 11:31:52 -06:00
c308b2881f Fix parser leak (fuzzing) 2014-12-30 11:31:52 -06:00
c959d1fca1 Fix lineno counting in jq_test.c 2014-12-30 11:28:50 -06:00
63511a874f Add support for testing erroneous programs
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-30 10:55:30 -06:00
90c705f138 Make --run-tests more informative
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-30 10:55:30 -06:00
b67bad82cb Allow resetting of jq err callback
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-30 10:52:38 -06:00
6981b46338 Fix streaming bug (fuzzing) 2014-12-30 01:35:22 -06:00
752e00bc66 transpose/0 for possibly jagged matrices 2014-12-27 18:52:36 -06:00
00f018a054 bsearch(x) (binary search): builtin.c (tested), with documentation and test case. Always yields an integer (even if input is unsorted); returns (-1 - ix) if x is not in input array. 2014-12-27 18:44:20 -06:00
56344670f4 ascii_upcase/0 and ascii_downcase/0 2014-12-27 18:38:52 -06:00
5df20f4954 Add debug builtin
And refactor setup of jv dump flags.
2014-12-27 18:25:34 -06:00
a9c613e87d Don't force C API users to set input cb 2014-12-27 18:15:10 -06:00
7538ef34be Make jq --run-tests show test line numbers 2014-12-27 18:15:10 -06:00
5c62a4b805 Fix uninitialized struct field 2014-12-27 18:09:28 -06:00
559863ca68 Streaming parser torture tests 2014-12-26 23:18:07 -06:00