Commit Graph

1250 Commits

Author SHA1 Message Date
Nicolas Williams e7caf68edd Attempt to use builtin Oniguruma for CIs 2017-02-23 00:33:08 -06:00
Nicolas Williams c6374b6a1f Allow ./configure --with-oniguruma=builtin
This allows one to force the use of jq's builtin copy of Oniguruma
(builtin as a git submodule).

We still need to fix make dist to include that copy of Oniguruma.
2017-02-23 00:30:13 -06:00
Nicolas Williams 8cde328007 Allow var bindings in path expressions (#1347)
The expression in a variable binding is not and must not be seen as
being part of a path expression in which the variable binding appears.
2017-02-21 18:11:35 -06:00
Erik Brinkman 02bad4b298 Add local oniguruma submodule
Configure should still allow use of prebuilt onigurumas (whether
system-installed or in a special prefix).  If these are not found, and
configure was not called with `--without-oniguruma`, then use the vendored
oniguruma module.  If configure was called with `--without-oniguruma`, then we
do not build regex functionality into jq.
2017-02-18 21:34:26 -05:00
Nicolas Williams 9b2179089b Improve manual 2017-02-15 11:48:39 -06:00
William Langford 1c806b74ea Add builtins builtin 2017-02-13 11:36:20 -05:00
William Langford 8001955fb7 Fix memory leak in libm cfunctions 2017-02-13 11:36:20 -05:00
William Langford e6fa039f3f Merge pull request #1089 from l8nite/base64_decode 2017-02-12 16:25:44 -05:00
Shaun Guth e0b784ac6d Add @base64d for decoding base64 #47 2017-02-12 16:03:59 -05:00
J Phani Mahesh dc679081fa fix truncate_stream to match docs 2017-02-07 21:30:55 -06:00
Nicolas Williams 597c1f6667 Add more missing math functions 2017-02-04 00:11:46 -06:00
Nicolas Williams 125071cf00 Fix handling of unsupported math functions 2017-02-04 00:11:10 -06:00
Nicolas Williams 2fb099e4cf Promote wiki more in README 2017-01-31 16:13:32 -06:00
Nicolas Williams 6f9646a44f Improve docs somewhat, inspired by #1326 2017-01-30 14:11:05 -06:00
Nicolas Williams 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
Nicolas Williams aac8132f47 recurse (i.e., ..) needs to find leaf nulls 2017-01-30 14:11:05 -06:00
Nicolas Williams 7bdf3a39ad Add SQL-style operators (#1322) 2017-01-30 14:11:05 -06:00
Nicolas Williams 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
Nicolas Williams e24af3c78e reduce: handle empty updates (fix #1313) 2017-01-30 14:11:05 -06:00
Attila Fülöp e82147bbb8 Solaris needs XPG6 for c99 2017-01-28 19:16:23 -06:00
William Langford 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
William Langford 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
W-Mark Kubacki fd4ae8304e Parse no deeper than MAX_PARSING_DEPTH
while true; do printf '{"deeper": '; done | jq .
2017-01-27 09:59:44 -06:00
W-Mark Kubacki 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
Jakub Wilk 61b75639a7 gen_utf8_tables: remove unused variable 2017-01-26 13:15:59 -06:00
Jan Schulz 19d266b528 Revert "Disable appveyor build for now"
This reverts commit 0b8218515e.

There is a new oniguruma package which previously trashed the build.
2017-01-23 16:28:01 -06:00
Richard Groves 9c4238c2f6 Typo fixed
simply -> simple
2017-01-23 16:21:37 -06:00
Janne Cederberg 114ac72169 Documentation clarification suggestions 2017-01-23 15:48:44 -06:00
James Pearson Hughes 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
Tim McCormack f33af0b16a Typo: s/more/mode/ in --seq 2017-01-23 15:45:07 -06:00
Clément MATHIEU eeba7b3167 Fix input_(line_number|filename) leak memory 2017-01-23 15:18:51 -06:00
Jay Satiro 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
Nicolas Williams 0b8218515e Disable appveyor build for now 2016-03-21 18:59:52 -05:00
David Tolnay 1a8a5ee000 Remove David from maintainers 2016-02-24 00:39:56 -08:00
Nicolas Williams 1740fd036d Travis-CI build for OSX (fix #1083) 2016-01-19 00:19:24 -06:00
Nicolas Williams 6c635998f8 Always test sort_by/group_by post-#1082 2016-01-18 12:17:58 -06:00
Stephen Dolan 7835a724d6 Make jv_sort stable regardless of qsort details. 2016-01-18 10:41:25 -06:00
Stephen Dolan 239c357af0 Add AppVeyor badge to README.md
Thanks @JanSchulz, @nicowilliams!
2016-01-18 10:15:43 +00:00
Nicolas Williams d228490162 Add --enable-ubsan (undefined behavior sanitizer) 2016-01-17 13:06:27 -06:00
Nicolas Williams b92a12cf6c Run failing tests on Windows; ignore failures 2016-01-17 12:46:57 -06:00
Nicolas Williams 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
Nicolas Williams 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
Nicolas Williams c3d13260a7 Tweak appveyor.yml; disable failing tests 2016-01-17 01:49:50 -06:00
Jan Schulz e6e07cd2c6 Upload build failure logs
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2016-01-16 17:02:43 -06:00
Jan Schulz ec4dfd32cc Build a html help
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2016-01-16 17:02:43 -06:00
Jan Schulz c0e01452f2 Run tests on appveyor
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2016-01-16 17:02:43 -06:00
Jan Schulz 45260890f2 Add 32bit windows builds on appveyor
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2016-01-16 17:02:43 -06:00
Jan Schulz 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
Nicolas Williams 093d20c3b9 Fix cross-compilation build 2016-01-16 16:51:06 -06:00
Nicolas Williams ec07936888 Fix Windows build (fix #911) 2016-01-16 16:51:01 -06:00