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

1087 Commits

Author SHA1 Message Date
6f9646a44f Improve docs somewhat, inspired by #1326 2017-01-30 14:11:05 -06:00
bd7b48c1b9 Make |= delete LHS when RHS is empty (Fix #1314)
Now that #1313 is fixed, |= no longer outputs null when the RHS update
expression outputs empty.

When a user wants to keep the current value of the LHS they would have
the RHS update expression output `.`, so having `empty` achieve the same
thing would be redundant.  The obvious thing to do is to delete the LHS
when the RHS update outputs `empty` (i.e., doesn't output any values).

It's reasonable to think that existing programs won't be broken by this
change, because reduce and |= not handling empty well is clearly a bug.
(Though it's possible that some programs were using empty to quickly
terminate reduce or |=, it's not likely.  They should use label/break
instead.)

Prior to this change |= would use the _last_ value output by the RHS
update expression.  With this change |= will use the _first_ value
instead.  This change _is_ a minor backwards-incompatible change.  It
may or may not be acceptable; we'll see.  It is a useful change in that
it makes |= faster when the update expression produces multiple values.
2017-01-30 14:11:05 -06:00
aac8132f47 recurse (i.e., ..) needs to find leaf nulls 2017-01-30 14:11:05 -06:00
7bdf3a39ad Add SQL-style operators (#1322) 2017-01-30 14:11:05 -06:00
396543191c Make first(g) more efficient: extract only 1 value
first(g) was extracting two values, which, if g is slow, made first(g)
slow.  And if the second extraction were to throw an error, then
first(g) would throw that error, which is clearly not the right thing to
do.  Besides that, first(g) was allocating garbage, which it no longer
does.
2017-01-30 14:11:05 -06:00
e24af3c78e reduce: handle empty updates (fix #1313) 2017-01-30 14:11:05 -06:00
e82147bbb8 Solaris needs XPG6 for c99 2017-01-28 19:16:23 -06:00
d2c3cf49e1 Merge pull request #1317 from wtlangford/dont-split-utf8-sequences
Handle cut-off UTF-8 sequences when reading files
2017-01-27 21:45:15 -05:00
e84d17196c Handle cut-off UTF-8 sequences when reading files
Read additional bytes from the file to complete the UTF-8 sequence so the bytes
in it don't get converted to U+FFFD replacement characters.
2017-01-27 21:04:26 -05:00
fd4ae8304e Parse no deeper than MAX_PARSING_DEPTH
while true; do printf '{"deeper": '; done | jq .
2017-01-27 09:59:44 -06:00
83e2cf607f Skip printing what's below a MAX_PRINT_DEPTH
This addresses #1136, and mitigates a stack exhaustion when printing
a very deeply nested term.
2017-01-27 09:59:44 -06:00
61b75639a7 gen_utf8_tables: remove unused variable 2017-01-26 13:15:59 -06:00
19d266b528 Revert "Disable appveyor build for now"
This reverts commit 0b8218515eabf1a967eba0dbcc7a0e5ae031a509.

There is a new oniguruma package which previously trashed the build.
2017-01-23 16:28:01 -06:00
9c4238c2f6 Typo fixed
simply -> simple
2017-01-23 16:21:37 -06:00
114ac72169 Documentation clarification suggestions 2017-01-23 15:48:44 -06:00
a10d7fbb02 Update download instructions for Arch
jq has been in the community repo for [just over a year now][0].

[0]: https://projects.archlinux.org/svntogit/community.git/commit/trunk?h=packages/jq&id=8d5e06065bc92bf56ea651970c9bda07fb545554
2017-01-23 15:46:17 -06:00
f33af0b16a Typo: s/more/mode/ in --seq 2017-01-23 15:45:07 -06:00
eeba7b3167 Fix input_(line_number|filename) leak memory 2017-01-23 15:18:51 -06:00
e5c30e6fae Fix cross-compile tmp dir removal
- cd out of the tmp dir before attempting to remove it.
2017-01-23 15:10:57 -06:00
0b8218515e Disable appveyor build for now 2016-03-21 18:59:52 -05:00
1a8a5ee000 Remove David from maintainers 2016-02-24 00:39:56 -08:00
1740fd036d Travis-CI build for OSX (fix #1083) 2016-01-19 00:19:24 -06:00
6c635998f8 Always test sort_by/group_by post-#1082 2016-01-18 12:17:58 -06:00
7835a724d6 Make jv_sort stable regardless of qsort details. 2016-01-18 10:41:25 -06:00
239c357af0 Add AppVeyor badge to README.md
Thanks @JanSchulz, @nicowilliams!
2016-01-18 10:15:43 +00:00
d228490162 Add --enable-ubsan (undefined behavior sanitizer) 2016-01-17 13:06:27 -06:00
b92a12cf6c Run failing tests on Windows; ignore failures 2016-01-17 12:46:57 -06:00
c514368f98 Make it possible to run tests with set -x
One can now run:

    make TRACE_TESTS=1 check

to get detailed output
2016-01-17 12:45:01 -06:00
062f86a625 Enable more tests on Windows; move sort_by tests
Use %%FAIL IGNORE MSG for error messages that differ on Windows, and
move the sort_by/group_by tests that fail qhen qsort() is not stable.

Now only tests/sorttest and tests/shtest are disabled on Windows.
2016-01-17 12:45:01 -06:00
c3d13260a7 Tweak appveyor.yml; disable failing tests 2016-01-17 01:49:50 -06:00
e6e07cd2c6 Upload build failure logs
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2016-01-16 17:02:43 -06:00
ec4dfd32cc Build a html help
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2016-01-16 17:02:43 -06:00
c0e01452f2 Run tests on appveyor
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2016-01-16 17:02:43 -06:00
45260890f2 Add 32bit windows builds on appveyor
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2016-01-16 17:02:43 -06:00
4337fc5fe0 Build on windows (mingw) on appveyor
For this to work, one of the core commiter should do:

* enable appveyor in the github project (grant access)
* Make an appveyor account and add the github jq repo as a new project

inspirations from:

appveyor, msys2, use bash environment to build...
* https://github.com/ariscop/elemental-ircd/blob/appveyor/appveyor.yml
* https://github.com/khaledhosny/ots/pull/67/files
* https://github.com/universal-ctags/ctags/blob/master/appveyor.yml
* https://github.com/universal-ctags/ctags/blob/master/win32/appveyor.bat

and with mvsc
* https://github.com/khaledhosny/ots/blob/master/.appveyor.yml

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2016-01-16 17:02:43 -06:00
093d20c3b9 Fix cross-compilation build 2016-01-16 16:51:06 -06:00
ec07936888 Fix Windows build (fix #911) 2016-01-16 16:51:01 -06:00
8e4724e16c fixup non-maintainer build 2016-01-15 16:06:18 -06:00
3afdbb7b7d Always build src/builtin.inc (fix #1069) 2016-01-15 11:59:14 -06:00
f217fa26ae MultiByteToWideChar() usage bug (fix #1072) 2016-01-15 11:58:41 -06:00
8f6f28c8d3 Make it easier to use jq with shebangs (fix #1044)
Allow a continuation on a comment immediately after a shebang to make
this traditional hack possible:

    #!/bin/sh
    # this next line is ignored by jq \
    exec jq -f "$0" "$@"
    # jq code follows

But continue only on the first line following a shebang, and only if
it's a comment.
2015-12-14 22:08:17 -08:00
856a4b2f3f Add note about IEEE754 to help msg 2015-12-15 00:00:03 -06:00
6d76cd0a99 Change usage formatting 2015-12-14 23:58:28 -06:00
6151f20477 Avoiding conditional directives that break statements 2015-12-09 15:29:35 -06:00
ad8d1a8cc8 Two sub bugs fixed; two new gsub tests have been added.
./jq --run-tests < tests/onig.test
has been run successfully:

...
Testing 'gsub("a";"b")' at line number 70
Testing 'gsub( "(.*)"; "";  "x")' at line number 74
...
22 of 22 tests passed (0 malformed)
2015-12-09 15:28:01 -06:00
ec583deefa Fix JV_OBJECT() and go up to 18 2015-12-01 23:27:19 -06:00
5fe053671a Assume . if either stdin/on isatty() (fix #1028)
And move the #define of isatty on Windows up.
2015-12-01 23:27:19 -06:00
0d177d240d yum has been replaced with dnf as of f22
https://fedoraproject.org/wiki/Changes/ReplaceYumWithDNF
2015-11-26 10:48:06 -05:00
18b4b18b41 Support --without-oniguruma 2015-11-21 10:05:37 -08:00
befd192958 Oniguruma hash in dockerfile 2015-11-18 00:30:18 -08:00