]> granicus.if.org Git - jq/log
jq
10 years agoAdd example of selecting object with keys 523/head
Adam Lindberg [Fri, 1 Aug 2014 10:13:35 +0000 (12:13 +0200)]
Add example of selecting object with keys

It is not very straight forward how to select objects by their attributes from an array. This example provides the basic use case of how to select some objects based key values.

10 years agoSome builtins are unnecessarily special (fix #521)
Nicolas Williams [Fri, 1 Aug 2014 05:20:30 +0000 (00:20 -0500)]
Some builtins are unnecessarily special (fix #521)

10 years agoCorrect @wtlangford's address
Nicolas Williams [Wed, 30 Jul 2014 18:19:46 +0000 (13:19 -0500)]
Correct @wtlangford's address

10 years agoAdd @wtlangford to the AUTHORS list
Nicolas Williams [Wed, 30 Jul 2014 18:02:34 +0000 (13:02 -0500)]
Add @wtlangford to the AUTHORS list

10 years agoAdd capture; document regular expression filters
pkoppstein [Sat, 19 Jul 2014 05:08:38 +0000 (01:08 -0400)]
Add capture; document regular expression filters

    Fix #493.

10 years agoAdd `first`, `nth`, `last` (fix #510)
Nicolas Williams [Mon, 28 Jul 2014 18:18:58 +0000 (13:18 -0500)]
Add `first`, `nth`, `last` (fix #510)

10 years agoFixing crash when a library's dependency could not be loaded.
William Langford [Wed, 23 Jul 2014 07:33:04 +0000 (03:33 -0400)]
Fixing crash when a library's dependency could not be loaded.

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
10 years agoFold constants (fix #504)
Nicolas Williams [Sun, 27 Jul 2014 22:33:22 +0000 (17:33 -0500)]
Fold constants (fix #504)

10 years agoFix #499, #500
Nicolas Williams [Sun, 27 Jul 2014 22:41:40 +0000 (17:41 -0500)]
Fix #499, #500

10 years agoChanging color codes to fix #495
William Langford [Tue, 22 Jul 2014 00:08:42 +0000 (20:08 -0400)]
Changing color codes to fix #495

10 years agoDo fix remaining bison warning (fix #433)
Nicolas Williams [Wed, 23 Jul 2014 03:49:30 +0000 (22:49 -0500)]
Do fix remaining bison warning (fix #433)

10 years agoRename jq_memmem() to _jq_memmem()
Nicolas Williams [Wed, 23 Jul 2014 03:44:52 +0000 (22:44 -0500)]
Rename jq_memmem() to _jq_memmem()

10 years agoAdded library system with -l, -L, and JQ_LIBRARY_PATH
William Langford [Wed, 9 Jul 2014 04:55:20 +0000 (00:55 -0400)]
Added library system with -l, -L, and JQ_LIBRARY_PATH

Created util.[ch] to hold common utilities.

10 years agoAdd -i option to edit files in place (fix #105)
Nicolas Williams [Sun, 20 Jul 2014 05:11:23 +0000 (00:11 -0500)]
Add -i option to edit files in place (fix #105)

10 years agoAdd -n to short usage msg; fix --arg msg
Nicolas Williams [Sun, 20 Jul 2014 05:04:24 +0000 (00:04 -0500)]
Add -n to short usage msg; fix --arg msg

10 years agoFix bison empty rule warnings (#433, partial fix)
Nicolas Williams [Mon, 14 Jul 2014 20:39:43 +0000 (15:39 -0500)]
Fix bison empty rule warnings (#433, partial fix)

10 years agoFix #484, try/catch syntax has conflicts
Nicolas Williams [Mon, 14 Jul 2014 20:38:58 +0000 (15:38 -0500)]
Fix #484, try/catch syntax has conflicts

10 years agoMerge pull request #483 from else/master
Nico Williams [Mon, 14 Jul 2014 14:16:01 +0000 (09:16 -0500)]
Merge pull request #483 from else/master

jq 1.4 is in Debian

10 years agojq 1.4 is in Debian 483/head
Simon Elsbrock [Mon, 14 Jul 2014 09:24:47 +0000 (11:24 +0200)]
jq 1.4 is in Debian

jq 1.4 is in Debian, please see https://tracker.debian.org/pkg/jq

10 years agoMerge pull request #482 from mbruggmann/manual-fixes
Nico Williams [Mon, 14 Jul 2014 00:01:57 +0000 (19:01 -0500)]
Merge pull request #482 from mbruggmann/manual-fixes

Fix manual example for `endswith`.

10 years agoAdd regression test for #479
Nicolas Williams [Mon, 14 Jul 2014 00:00:37 +0000 (19:00 -0500)]
Add regression test for #479

10 years agoLib defs don't bind to each other; fix #479 again
Nicolas Williams [Sun, 13 Jul 2014 23:36:27 +0000 (18:36 -0500)]
Lib defs don't bind to each other; fix #479 again

10 years agoFix manual example for `endswith`. 482/head
Marc Bruggmann [Sun, 13 Jul 2014 17:01:45 +0000 (19:01 +0200)]
Fix manual example for `endswith`.

10 years agoRevert "Library defs don't bind to each other; fix #479"
Nicolas Williams [Sun, 13 Jul 2014 07:04:27 +0000 (02:04 -0500)]
Revert "Library defs don't bind to each other; fix #479"

This reverts commit 6b6e3f42627f360cbbad2287968b2a209ab43593.  It was
the wrong fix.

10 years agoLibrary defs don't bind to each other; fix #479
Nicolas Williams [Sat, 12 Jul 2014 23:37:23 +0000 (18:37 -0500)]
Library defs don't bind to each other; fix #479

10 years agoFix #478 assertion failure
Nicolas Williams [Fri, 11 Jul 2014 00:20:58 +0000 (19:20 -0500)]
Fix #478 assertion failure

10 years agoMerge pull request #475 from qqshfox/patch-1
Nico Williams [Wed, 9 Jul 2014 15:09:28 +0000 (10:09 -0500)]
Merge pull request #475 from qqshfox/patch-1

Fix examples for `del` in manual

10 years agoFix examples for `del` in manual 475/head
Hanfei Shen [Wed, 9 Jul 2014 08:31:25 +0000 (16:31 +0800)]
Fix examples for `del` in manual

10 years agoFix invalid YAML in manual.yml
Zhiming Wang [Wed, 9 Jul 2014 03:32:00 +0000 (20:32 -0700)]
Fix invalid YAML in manual.yml

Grave accent "`" is a reserved indicator in YAML per
http://www.yaml.org/spec/1.2/spec.html#id2774228, so it can't start a
plain scalar. This commit applies quoting to titles beginning with
grave accents.

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
10 years agoAdd tests/all.trs to .gitignore
Zhiming Wang [Wed, 9 Jul 2014 03:55:50 +0000 (20:55 -0700)]
Add tests/all.trs to .gitignore

tests/all.trs is auto generated during make check.

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
10 years agoBetter document `path()`'s power; also `|=`
Nicolas Williams [Wed, 9 Jul 2014 06:05:06 +0000 (01:05 -0500)]
Better document `path()`'s power; also `|=`

10 years agoAdd `foreach EXP as $var (INIT; UPDATE)` form
Nicolas Williams [Wed, 9 Jul 2014 05:43:06 +0000 (00:43 -0500)]
Add `foreach EXP as $var (INIT; UPDATE)` form

10 years agoMake `while()` handle `break`
Nicolas Williams [Wed, 9 Jul 2014 05:39:25 +0000 (00:39 -0500)]
Make `while()` handle `break`

10 years agoMake C-coded built-ins take `jq_state *` argument
Nicolas Williams [Tue, 8 Jul 2014 03:49:46 +0000 (22:49 -0500)]
Make C-coded built-ins take `jq_state *` argument

10 years ago`error(x)` should not `tostring` its arg; fix #466
Nicolas Williams [Tue, 8 Jul 2014 03:26:53 +0000 (22:26 -0500)]
`error(x)` should not `tostring` its arg; fix #466

10 years ago`limit` should use `break`
Nicolas Williams [Tue, 8 Jul 2014 03:26:07 +0000 (22:26 -0500)]
`limit` should use `break`

10 years agoMake `any/2` and `all/2` efficient using `foreach`
Nicolas Williams [Tue, 8 Jul 2014 03:25:34 +0000 (22:25 -0500)]
Make `any/2` and `all/2` efficient using `foreach`

10 years agoexec_stack.h was not using jv_mem_realloc()
Nicolas Williams [Mon, 23 Dec 2013 23:13:19 +0000 (17:13 -0600)]
exec_stack.h was not using jv_mem_realloc()

10 years agojv_invalid() shouldn't allocate
Nicolas Williams [Tue, 24 Dec 2013 18:24:14 +0000 (12:24 -0600)]
jv_invalid() shouldn't allocate

jv_invalid() should behave like jv_invalid_with_msg(jv_null()), and
neither should allocate memory, because neither ought to need to.

10 years agojv_show() should be able to display invalid values
Nicolas Williams [Wed, 1 Jan 2014 05:25:20 +0000 (23:25 -0600)]
jv_show() should be able to display invalid values

10 years agoAdd `break` builtin for `foreach`
Nicolas Williams [Mon, 7 Jul 2014 23:48:13 +0000 (18:48 -0500)]
Add `break` builtin for `foreach`

10 years agoExplain `foreach`'s powers a bit more
Nicolas Williams [Mon, 7 Jul 2014 22:22:53 +0000 (17:22 -0500)]
Explain `foreach`'s powers a bit more

10 years agoDocument `path(path_expression)` builtin
Nicolas Williams [Mon, 7 Jul 2014 22:13:51 +0000 (17:13 -0500)]
Document `path(path_expression)` builtin

10 years agoAdd missing backtick in manual
Nicolas Williams [Mon, 7 Jul 2014 22:13:48 +0000 (17:13 -0500)]
Add missing backtick in manual

10 years ago$var["foo"]=1 can't work as expected; doc fix #236
Nicolas Williams [Mon, 7 Jul 2014 21:52:23 +0000 (16:52 -0500)]
$var["foo"]=1 can't work as expected; doc fix #236

10 years agoBetter check for lib has only functions (fix #138)
Nicolas Williams [Mon, 7 Jul 2014 21:03:32 +0000 (16:03 -0500)]
Better check for lib has only functions (fix #138)

10 years agoAdd `any/N` and `all/N` x N in (1, 2) (fix #455)
Nicolas Williams [Mon, 7 Jul 2014 01:08:06 +0000 (20:08 -0500)]
Add `any/N` and `all/N` x N in (1, 2) (fix #455)

    Contributed by @pkoppstein.

10 years agoAdd `foreach` and `limit`
Nicolas Williams [Sun, 6 Jul 2014 08:24:29 +0000 (03:24 -0500)]
Add `foreach` and `limit`

10 years agoAdd support for negative indices for .[]; fix #462
William Langford [Fri, 4 Jul 2014 16:08:47 +0000 (12:08 -0400)]
Add support for negative indices for .[]; fix #462

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
10 years agoAdd general `?` operator
Nicolas Williams [Sun, 6 Jul 2014 05:11:55 +0000 (00:11 -0500)]
Add general `?` operator

10 years agoAdd `try EXP catch EXP`
Nicolas Williams [Sun, 6 Jul 2014 01:54:42 +0000 (20:54 -0500)]
Add `try EXP catch EXP`

10 years agoDocument `error/1`
Nicolas Williams [Sun, 6 Jul 2014 05:26:22 +0000 (00:26 -0500)]
Document `error/1`

10 years agoAdd `while(cond; update)` (fix #314)
Nicolas Williams [Thu, 3 Jul 2014 02:45:49 +0000 (21:45 -0500)]
Add `while(cond; update)` (fix #314)

10 years agoAdd `range(init;upto;by)` (fix #317)
Nicolas Williams [Thu, 3 Jul 2014 02:22:53 +0000 (21:22 -0500)]
Add `range(init;upto;by)` (fix #317)

10 years agoMulti-arity needs better errors (fix #438)
Nicolas Williams [Wed, 2 Jul 2014 07:18:10 +0000 (02:18 -0500)]
Multi-arity needs better errors (fix #438)

10 years agoDescrive generators, range() with by to manual
Nicolas Williams [Wed, 2 Jul 2014 04:32:44 +0000 (23:32 -0500)]
Descrive generators, range() with by to manual

10 years agoFix typo in manual
Nicolas Williams [Wed, 2 Jul 2014 04:32:40 +0000 (23:32 -0500)]
Fix typo in manual

10 years agoFixed base64 issue with UTF-8 strings
William Langford [Tue, 1 Jul 2014 17:17:48 +0000 (13:17 -0400)]
Fixed base64 issue with UTF-8 strings

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
10 years agoTeach disassembler about TAIL_CALL_JQ
Nicolas Williams [Wed, 2 Jul 2014 03:49:25 +0000 (22:49 -0500)]
Teach disassembler about TAIL_CALL_JQ

10 years agoFix off-by-one in TCO
Nicolas Williams [Wed, 2 Jul 2014 03:40:40 +0000 (22:40 -0500)]
Fix off-by-one in TCO

    Now we have the ability to define a generator in jq:

        def for(cond; update):
            def _for:
                if cond then ., (update | _for) else . end;
            _for;

        for(. < 10; . + 1) # generates numbers between `.` and 10

    Running this by hand with --debug-dump-disasm (with a fix for that
    coming up next) we can see that the call to _for is optimized:

        _for:0:
          0000 DUP
          0001 CALL_JQ cond:0^1
          0005 JUMP_F 0022
          0007 POP
          0008 FORK 0012
          0010 JUMP 0020
          0012 CALL_JQ update:1^1
          0016 TAIL_CALL_JQ _for:0^1
          0020 JUMP 0023
          0022 POP
          0023 RET

    And timing this with 1000, 10000, 100000 iterations shows that
    indeed we must be applying TCO; otherwise, without TCO, this gets
    very slow very quickly.

10 years agoTCO to the max!
Nicolas Williams [Tue, 1 Jul 2014 04:41:20 +0000 (23:41 -0500)]
TCO to the max!

    Close #446.

    Currently tested by disassembling and tracing various recursive jq
    programs by hand under valgrind.  An improved test framework that
    can test for errors and specific bytecode patterns is in
    development.

10 years agoAdded cross-compilation script to build libjq for iOS.
William Langford [Wed, 25 Jun 2014 07:13:17 +0000 (03:13 -0400)]
Added cross-compilation script to build libjq for iOS.

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
10 years agoLet @uri produce uppercase hexadecimal digits...
Zhiming Wang [Mon, 30 Jun 2014 02:48:01 +0000 (19:48 -0700)]
Let @uri produce uppercase hexadecimal digits...

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>
10 years agoAdd much commentary about CALL_JQ and call frames
Nicolas Williams [Tue, 1 Jul 2014 00:40:56 +0000 (19:40 -0500)]
Add much commentary about CALL_JQ and call frames

10 years agoGet "Try Online" button working (fix #440)
Nicolas Williams [Tue, 24 Jun 2014 05:39:00 +0000 (00:39 -0500)]
Get "Try Online" button working (fix #440)

10 years agoImprove TCO
Nicolas Williams [Tue, 24 Jun 2014 00:59:00 +0000 (19:59 -0500)]
Improve TCO

Instead of checking for self-recursion check that the thing we're
calling is a function and not a closure, therefore the new frame will
have the same env as the current frame.

10 years agoTail call optimization (close #437)
Nicolas Williams [Sun, 22 Jun 2014 05:24:02 +0000 (00:24 -0500)]
Tail call optimization (close #437)

10 years agoFix option stacking bug
Nicolas Williams [Sat, 21 Jun 2014 23:01:00 +0000 (18:01 -0500)]
Fix option stacking bug

10 years agoRemove stray fprintf() from last commit
Nicolas Williams [Sat, 21 Jun 2014 04:29:53 +0000 (23:29 -0500)]
Remove stray fprintf() from last commit

10 years agoAllow stacking of short options (fix #346)
Nicolas Williams [Sat, 21 Jun 2014 04:26:54 +0000 (23:26 -0500)]
Allow stacking of short options (fix #346)

10 years agoRemove extra free of testmode
Nicolas Williams [Thu, 19 Jun 2014 02:11:06 +0000 (21:11 -0500)]
Remove extra free of testmode

I added a jv_free() too many while rebasing @wtlangford's contribution.
It could only be triggered by calling `_match_impl` directly.

10 years agoAdded regex support as per issue #164.
William Langford [Wed, 18 Jun 2014 23:49:38 +0000 (19:49 -0400)]
Added regex support as per issue #164.

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>
10 years agoPartial revamp of `scripts/crosscompile`
Nicolas Williams [Wed, 18 Jun 2014 21:29:37 +0000 (16:29 -0500)]
Partial revamp of `scripts/crosscompile`

Fix #430.

10 years agoMinor style cleanup in main.c
Nicolas Williams [Wed, 18 Jun 2014 00:04:55 +0000 (19:04 -0500)]
Minor style cleanup in main.c

10 years agoRemove remnants of `--online-input` option
Nicolas Williams [Wed, 18 Jun 2014 00:02:23 +0000 (19:02 -0500)]
Remove remnants of `--online-input` option

10 years agoAdd `-j` / `--join-output` option, similar to `-r`
Nicolas Williams [Tue, 17 Jun 2014 23:59:35 +0000 (18:59 -0500)]
Add `-j` / `--join-output` option, similar to `-r`

Fix #215.

10 years agoFixed typo.
David Haguenauer [Thu, 20 Mar 2014 20:31:09 +0000 (21:31 +0100)]
Fixed typo.

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
10 years agoRebuild jq.1.prebuilt
Nicolas Williams [Tue, 17 Jun 2014 23:13:35 +0000 (18:13 -0500)]
Rebuild jq.1.prebuilt

10 years agoRemove trailing whitespace from manual.yml
Nicolas Williams [Tue, 17 Jun 2014 23:13:14 +0000 (18:13 -0500)]
Remove trailing whitespace from manual.yml

10 years agoUse new style in manual for defs with args
Nicolas Williams [Tue, 17 Jun 2014 23:11:31 +0000 (18:11 -0500)]
Use new style in manual for defs with args

10 years agoSimplified standard library
Santiago Lapresta [Tue, 17 Jun 2014 22:15:22 +0000 (00:15 +0200)]
Simplified standard library

Close #426.

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
10 years agoFix #419, improve Cannot index message (sortof)
Nicolas Williams [Tue, 17 Jun 2014 22:00:23 +0000 (17:00 -0500)]
Fix #419, improve Cannot index message (sortof)

jv_get() doesn't know if it's being called in the context of a jq
program or not, so it can't produce a very useful error message when the
types of the to-be-indexed value and the key don't agree.  For now,
including the key (when it is a short string) in the error message is as
significant an improvement as is easy to make.

10 years agoFix #266; make help message more useful
Nicolas Williams [Tue, 17 Jun 2014 21:47:12 +0000 (16:47 -0500)]
Fix #266; make help message more useful

10 years agoFix #280: from_entries of [] is null, should be {}
Nicolas Williams [Tue, 17 Jun 2014 03:40:44 +0000 (22:40 -0500)]
Fix #280: from_entries of [] is null, should be {}

10 years agoNo args default w/ tty stdout, not tty stdin #220
Nicolas Williams [Tue, 17 Jun 2014 02:28:30 +0000 (21:28 -0500)]
No args default w/ tty stdout, not tty stdin #220

10 years agoDon't declare environ on WIN32
Nicolas Williams [Tue, 17 Jun 2014 03:33:24 +0000 (22:33 -0500)]
Don't declare environ on WIN32

10 years agoAdded `flatten` and `flatten(x)` functions
Santiago Lapresta [Mon, 16 Jun 2014 00:34:18 +0000 (02:34 +0200)]
Added `flatten` and `flatten(x)` functions

Fix #415.

10 years agoRemove download 1.3 button; reposition try online
Nicolas Williams [Mon, 16 Jun 2014 22:01:09 +0000 (17:01 -0500)]
Remove download 1.3 button; reposition try online

10 years agoAdd ChangeLog and NEWS files
Nicolas Williams [Mon, 16 Jun 2014 20:29:48 +0000 (15:29 -0500)]
Add ChangeLog and NEWS files

10 years agoAdd missing contributors to AUTHORS
Nicolas Williams [Mon, 16 Jun 2014 20:29:31 +0000 (15:29 -0500)]
Add missing contributors to AUTHORS

10 years agoUpdate AUTHORS
Nicolas Williams [Mon, 16 Jun 2014 18:25:50 +0000 (13:25 -0500)]
Update AUTHORS

10 years agoFix Win64 jq.exe link on main page
Nicolas Williams [Mon, 16 Jun 2014 16:13:55 +0000 (11:13 -0500)]
Fix Win64 jq.exe link on main page

10 years agoAllow multiple functions with different arities
Nicolas Williams [Sun, 15 Jun 2014 04:53:15 +0000 (23:53 -0500)]
Allow multiple functions with different arities

10 years agoFix typo; rename jq.1-prebuit to jq.1.prebuilt
Nicolas Williams [Sat, 14 Jun 2014 00:04:06 +0000 (19:04 -0500)]
Fix typo; rename jq.1-prebuit to jq.1.prebuilt

10 years agoAdd `env` builtin
Nicolas Williams [Fri, 13 Jun 2014 22:51:41 +0000 (17:51 -0500)]
Add `env` builtin

10 years agoDocument the lambda nature of function args #391
Nicolas Williams [Fri, 13 Jun 2014 22:22:43 +0000 (17:22 -0500)]
Document the lambda nature of function args #391

10 years agoAutomatically update jq.1.prebuilt
Nicolas Williams [Fri, 13 Jun 2014 22:22:17 +0000 (17:22 -0500)]
Automatically update jq.1.prebuilt

10 years agoAdd jqplay link to the site
Nicolas Williams [Fri, 13 Jun 2014 22:21:56 +0000 (17:21 -0500)]
Add jqplay link to the site

10 years agojqplay has a domain now 408/head
Jingwen Owen Ou [Fri, 13 Jun 2014 01:17:39 +0000 (18:17 -0700)]
jqplay has a domain now

10 years agoAdd links to Solaris 11+ executables
Nicolas Williams [Fri, 13 Jun 2014 00:26:05 +0000 (19:26 -0500)]
Add links to Solaris 11+ executables