]> granicus.if.org Git - jq/log
jq
11 years agoRemove unnecessary #includes
Nicolas Williams [Mon, 29 Apr 2013 01:12:15 +0000 (20:12 -0500)]
Remove unnecessary #includes

11 years agoRemove globals/make jq_init/next/teardown() an API
Nicolas Williams [Sun, 28 Apr 2013 23:33:45 +0000 (18:33 -0500)]
Remove globals/make jq_init/next/teardown() an API

11 years agoFix negative number syntax. Add a unary '-' operator.
Stephen Dolan [Thu, 3 Jan 2013 12:53:06 +0000 (12:53 +0000)]
Fix negative number syntax. Add a unary '-' operator.

Closes #63.

11 years agoChange APPEND opcode to directly modify a variable.
Stephen Dolan [Thu, 3 Jan 2013 12:51:33 +0000 (12:51 +0000)]
Change APPEND opcode to directly modify a variable.

Avoids a big O(n^2) loop in constructing arrays. Fixes #61.

11 years agoClean up jv_object_foreach and add jv_array_foreach
Stephen Dolan [Mon, 31 Dec 2012 23:27:00 +0000 (23:27 +0000)]
Clean up jv_object_foreach and add jv_array_foreach

11 years agoIgnore some more stuff.
Stephen Dolan [Mon, 31 Dec 2012 23:25:12 +0000 (23:25 +0000)]
Ignore some more stuff.

11 years agoAdd the `recurse` function. See #37.
Stephen Dolan [Sat, 29 Dec 2012 22:59:07 +0000 (22:59 +0000)]
Add the `recurse` function. See #37.

11 years agoMake null + foo return foo, rather than an error.
Stephen Dolan [Sat, 29 Dec 2012 16:50:58 +0000 (16:50 +0000)]
Make null + foo return foo, rather than an error.

This also allows 'add' to be implemented in jq rather than C.

11 years agoRefactor assignment.
Stephen Dolan [Sat, 29 Dec 2012 16:43:36 +0000 (16:43 +0000)]
Refactor assignment.

New version is much more elegant and probably slower. Uses
library functions implemented in jq rather than dedicated opcodes.

11 years agoImprovements to del(foo).
Stephen Dolan [Sat, 29 Dec 2012 16:13:06 +0000 (16:13 +0000)]
Improvements to del(foo).

del(foo,bar) is now very different from del(foo),del(bar).
See #37.

12 years agoFix a bug in URI-encoding of certain non-ASCII characters.
Stephen Dolan [Sat, 29 Dec 2012 01:37:22 +0000 (01:37 +0000)]
Fix a bug in URI-encoding of certain non-ASCII characters.

Oh how I hate C casting rules.

12 years agoPath manipulation (path/getpath/setpath/delpath) and docs.
Stephen Dolan [Fri, 28 Dec 2012 16:08:29 +0000 (16:08 +0000)]
Path manipulation (path/getpath/setpath/delpath) and docs.

del function should fix #37.

12 years agoSupport for two-argument functions.
Stephen Dolan [Fri, 28 Dec 2012 15:07:27 +0000 (15:07 +0000)]
Support for two-argument functions.

Should probably support n args instead. This is a quick hack.
Also, ';' is a slightly ugly argument separator.

12 years agoFold operation (code/docs/test)
Stephen Dolan [Fri, 28 Dec 2012 15:04:16 +0000 (15:04 +0000)]
Fold operation (code/docs/test)

12 years agoDocs typos.
Stephen Dolan [Fri, 28 Dec 2012 14:21:28 +0000 (14:21 +0000)]
Docs typos.

12 years ago@foo syntax for encoding of strings into various formats.
Stephen Dolan [Thu, 27 Dec 2012 20:49:34 +0000 (20:49 +0000)]
@foo syntax for encoding of strings into various formats.

Fixes part of #47 and #48.

12 years agoFix an embarassing I/O bug.
Stephen Dolan [Thu, 27 Dec 2012 01:57:09 +0000 (01:57 +0000)]
Fix an embarassing I/O bug.

Pulling some I/O out to a function meant that buf changed from
"char buf[4096]" to "char* buf", and "sizeof(buf)" got a lot
less interesting. The upshot of this is that jq read input eight
bytes at a time, which is not the fastest.

12 years agoJSON parsing error messages now specify a location of the error.
Stephen Dolan [Thu, 27 Dec 2012 01:56:23 +0000 (01:56 +0000)]
JSON parsing error messages now specify a location of the error.

Should help with #53.

12 years agoSneaky valgrind trick to detect stack memory issues.
Stephen Dolan [Mon, 24 Dec 2012 17:11:18 +0000 (17:11 +0000)]
Sneaky valgrind trick to detect stack memory issues.

After something is popped from a stack, we overwrite the memory
with uninitialised data (if JQ_DEBUG is on). This means that
valgrind reports use-after-pop as an uninitialised memory error.

12 years agoFix a bad memory leak when using --raw-output
Stephen Dolan [Sun, 23 Dec 2012 15:41:20 +0000 (15:41 +0000)]
Fix a bad memory leak when using --raw-output

12 years agoGive Windows builds a proper .exe suffix.
Stephen Dolan [Thu, 20 Dec 2012 15:12:14 +0000 (15:12 +0000)]
Give Windows builds a proper .exe suffix.

12 years agoVersion 1.2! jq-1.2
Stephen Dolan [Thu, 20 Dec 2012 12:26:15 +0000 (12:26 +0000)]
Version 1.2!

12 years agoAdd a few lines to the bottom of the manpage.
Stephen Dolan [Thu, 20 Dec 2012 12:25:50 +0000 (12:25 +0000)]
Add a few lines to the bottom of the manpage.

12 years agoUpdate download page and build system to handle more platforms.
Stephen Dolan [Thu, 20 Dec 2012 12:17:56 +0000 (12:17 +0000)]
Update download page and build system to handle more platforms.

12 years agoDon't enable coloured output by default on Windows.
Stephen Dolan [Thu, 20 Dec 2012 12:16:22 +0000 (12:16 +0000)]
Don't enable coloured output by default on Windows.

12 years agoMerge pull request #50 from stesh/master
Stephen Dolan [Thu, 20 Dec 2012 11:41:19 +0000 (03:41 -0800)]
Merge pull request #50 from stesh/master

Add information about installing dev environment on OS X

12 years agoFix a bug in stack reallocation during deep recursion.
Stephen Dolan [Tue, 18 Dec 2012 17:36:24 +0000 (17:36 +0000)]
Fix a bug in stack reallocation during deep recursion.

12 years agoPrint an error message and abort in out-of-memory situations.
Stephen Dolan [Tue, 18 Dec 2012 17:01:23 +0000 (17:01 +0000)]
Print an error message and abort in out-of-memory situations.

Closes #43.

Tested with:

    ulimit -v 5000
    ./jq -n -c 'def f(x): x,f([x,x]); f(0)'

12 years agoAdd wrappers for malloc/realloc/free. See #43.
Stephen Dolan [Tue, 18 Dec 2012 16:52:47 +0000 (16:52 +0000)]
Add wrappers for malloc/realloc/free. See #43.

12 years agoAdd the ability to specify input files on the commandline.
Stephen Dolan [Sun, 16 Dec 2012 19:46:41 +0000 (19:46 +0000)]
Add the ability to specify input files on the commandline.

See #21.

12 years agoImprove manpage introduction, add examples to manpage.
Stephen Dolan [Sun, 16 Dec 2012 17:11:40 +0000 (17:11 +0000)]
Improve manpage introduction, add examples to manpage.

Closes #19

12 years agoFix a bug uncovered by tests extracted from manual.
Stephen Dolan [Sun, 16 Dec 2012 13:10:48 +0000 (13:10 +0000)]
Fix a bug uncovered by tests extracted from manual.

`null | length` should give 0, and now does.

12 years agoLots of build system and docs improvements, including a manpage.
Stephen Dolan [Sun, 16 Dec 2012 13:06:03 +0000 (13:06 +0000)]
Lots of build system and docs improvements, including a manpage.

 - Build binaries for multiple platforms
 - Make a manpage out of the manual (see #19)
 - Extract more tests from the documentation
 - Fix a few documentation bugs uncovered by above.

12 years agoAdd a Gemfile to make building the documentation easier.
Stephen Dolan [Wed, 12 Dec 2012 23:18:43 +0000 (23:18 +0000)]
Add a Gemfile to make building the documentation easier.

Use "bundle install" in the docs folder to install ruby dependencies.

12 years agoDelete autogenerated source from the repository.
Stephen Dolan [Mon, 10 Dec 2012 22:36:01 +0000 (22:36 +0000)]
Delete autogenerated source from the repository.

This was a horrible hack to fix build issues on OS X some time
ago. There are better ways to fix build issues on OS X :)

See #49.

12 years agosome words explaining struct inst a little
Stephen Dolan [Mon, 10 Dec 2012 22:35:33 +0000 (22:35 +0000)]
some words explaining struct inst a little

12 years agoerror() function
Stephen Dolan [Mon, 10 Dec 2012 22:30:09 +0000 (22:30 +0000)]
error() function

12 years agoFix Rack setup so that viewing documentation locally is less painful.
Stephen Dolan [Mon, 10 Dec 2012 22:25:11 +0000 (22:25 +0000)]
Fix Rack setup so that viewing documentation locally is less painful.

12 years agoRemove old OS X 'instructions' 50/head
Stephen Shaw [Fri, 7 Dec 2012 14:40:20 +0000 (14:40 +0000)]
Remove old OS X 'instructions'

12 years agoAdd information about installing dev environment on OS X
Stephen Shaw [Fri, 7 Dec 2012 14:31:59 +0000 (14:31 +0000)]
Add information about installing dev environment on OS X

12 years agoChange order of evaluation for certain indexing operations.
Stephen Dolan [Fri, 7 Dec 2012 00:26:00 +0000 (00:26 +0000)]
Change order of evaluation for certain indexing operations.

'.foo[.bar]' used to parse like '.foo | .bar as $b | .[$b]',
now it parses like '.bar as $b | .foo | .[$b]'.

12 years agoAdd min, max, min_by, max_by functions.
Stephen Dolan [Tue, 4 Dec 2012 22:45:03 +0000 (22:45 +0000)]
Add min, max, min_by, max_by functions.

12 years agoRefactor function argument passing into what it always should have been.
Stephen Dolan [Tue, 4 Dec 2012 00:39:21 +0000 (00:39 +0000)]
Refactor function argument passing into what it always should have been.

Most visible change is that error messages when a function is called
with the wrong number of arguments are much better.

12 years agoExtend `{foo}` syntax to allow `{"foo"}` as well.
Stephen Dolan [Mon, 3 Dec 2012 20:31:40 +0000 (20:31 +0000)]
Extend `{foo}` syntax to allow `{"foo"}` as well.

Useful when "foo" contains unusual characters. Should help with
the issues #7, #38, #40, #42.

12 years agoGeneral cleanup - rename a few things, delete dead code.
Stephen Dolan [Mon, 3 Dec 2012 20:00:36 +0000 (20:00 +0000)]
General cleanup - rename a few things, delete dead code.

12 years agoAdd a `unique` function.
Stephen Dolan [Mon, 3 Dec 2012 02:02:12 +0000 (02:02 +0000)]
Add a `unique` function.

12 years agoSee, I told you colour was a bad idea! #11
Stephen Dolan [Mon, 3 Dec 2012 02:00:29 +0000 (02:00 +0000)]
See, I told you colour was a bad idea! #11

Last commit broke the build, minor fix needed to testsuite.

12 years agoOh alright then, if you insist.
Stephen Dolan [Mon, 3 Dec 2012 01:21:07 +0000 (01:21 +0000)]
Oh alright then, if you insist.

Colo(u)red output for jq. Enabled by default if isatty(stdout).
Closes #11.

12 years agoIgnore a UTF-8 BOM if one appears at the start of a JSON document.
Stephen Dolan [Sun, 2 Dec 2012 23:53:55 +0000 (23:53 +0000)]
Ignore a UTF-8 BOM if one appears at the start of a JSON document.
Closes #45.

12 years agoMake the -c output more compact. Closes #44.
Stephen Dolan [Sun, 2 Dec 2012 23:24:07 +0000 (23:24 +0000)]
Make the -c output more compact. Closes #44.

12 years agosort_by and group_by functions, tests and docs.
Stephen Dolan [Sun, 2 Dec 2012 23:22:15 +0000 (23:22 +0000)]
sort_by and group_by functions, tests and docs.

12 years agoDemote "contains" to a built-in function rather than an operator.
Stephen Dolan [Sun, 2 Dec 2012 22:24:02 +0000 (22:24 +0000)]
Demote "contains" to a built-in function rather than an operator.

12 years agoFix a horrible scoping/associativity bug.
Stephen Dolan [Sun, 2 Dec 2012 22:22:08 +0000 (22:22 +0000)]
Fix a horrible scoping/associativity bug.

`1 as $x | . | $x` didn't compile, as it was parsed as

    (1 as $x | .) | $x

where `$x` is undefined, rather than as

    1 as $x | (. | $x)

12 years agoClean up implementation of builtin functions.
Stephen Dolan [Sun, 2 Dec 2012 22:12:08 +0000 (22:12 +0000)]
Clean up implementation of builtin functions.

12 years agoMove all the includes one place to the left
Stephen Dolan [Sun, 2 Dec 2012 21:25:54 +0000 (21:25 +0000)]
Move all the includes one place to the left

12 years agoClean up calls to C functions, unify opcodes
Stephen Dolan [Sun, 2 Dec 2012 20:45:55 +0000 (20:45 +0000)]
Clean up calls to C functions, unify opcodes

12 years agoRefactor of function call codegen. Separate codegen for C and jq calls.
Stephen Dolan [Sat, 1 Dec 2012 19:41:36 +0000 (19:41 +0000)]
Refactor of function call codegen. Separate codegen for C and jq calls.

12 years agoSort function and more general comparison operators.
Stephen Dolan [Fri, 30 Nov 2012 20:27:16 +0000 (20:27 +0000)]
Sort function and more general comparison operators.

12 years agoMerge remote-tracking branch 'origin/master'
Stephen Dolan [Mon, 26 Nov 2012 22:23:30 +0000 (22:23 +0000)]
Merge remote-tracking branch 'origin/master'

12 years agoMove some higher-level JSON manipulation functions into jv_aux.{c,h}
Stephen Dolan [Mon, 26 Nov 2012 22:22:45 +0000 (22:22 +0000)]
Move some higher-level JSON manipulation functions into jv_aux.{c,h}

12 years agoDefine bytecoded builtins more concisely.
Stephen Dolan [Mon, 26 Nov 2012 18:53:47 +0000 (18:53 +0000)]
Define bytecoded builtins more concisely.

12 years agoRaise a proper error from the lexer on unmatched },),]
Stephen Dolan [Mon, 26 Nov 2012 01:40:35 +0000 (01:40 +0000)]
Raise a proper error from the lexer on unmatched },),]

12 years agoTransparent handling for CBV arguments to C functions.
Stephen Dolan [Mon, 26 Nov 2012 01:36:55 +0000 (01:36 +0000)]
Transparent handling for CBV arguments to C functions.

C function arguments closures are inlined before the call.

12 years agoClean up function creation API and epilogue generation.
Stephen Dolan [Mon, 26 Nov 2012 00:39:01 +0000 (00:39 +0000)]
Clean up function creation API and epilogue generation.

12 years agoAdd some preprocessor junk to make codegen cleaner.
Stephen Dolan [Sun, 25 Nov 2012 23:49:57 +0000 (23:49 +0000)]
Add some preprocessor junk to make codegen cleaner.

12 years agoMinor refactor of function call setup to allow for multiple arguments.
Stephen Dolan [Sun, 25 Nov 2012 23:07:43 +0000 (23:07 +0000)]
Minor refactor of function call setup to allow for multiple arguments.

12 years agoMerge pull request #36 from stroan/contains-operator
Stephen Dolan [Thu, 25 Oct 2012 18:51:55 +0000 (11:51 -0700)]
Merge pull request #36 from stroan/contains-operator

Implemented contains operator

12 years agoMerge branch 'master' of https://github.com/stedolan/jq into contains-operator 36/head
Stephen Roantree [Thu, 25 Oct 2012 17:02:02 +0000 (10:02 -0700)]
Merge branch 'master' of https://github.com/stedolan/jq into contains-operator

Conflicts:
lexer.gen.c
parser.gen.c
parser.gen.h
parser.gen.info
parser.y

12 years agoRemove redundant code from jv_object_contains
Stephen Roantree [Thu, 25 Oct 2012 13:29:23 +0000 (06:29 -0700)]
Remove redundant code from jv_object_contains

12 years agoRestructure contains methods to use public jv methods
Stephen Roantree [Thu, 25 Oct 2012 01:29:33 +0000 (18:29 -0700)]
Restructure contains methods to use public jv methods

12 years agoFix a bug in string parsing. Closes #35
Stephen Dolan [Wed, 24 Oct 2012 23:13:39 +0000 (00:13 +0100)]
Fix a bug in string parsing. Closes #35

12 years agoImplemented contains operator
Stephen Roantree [Wed, 24 Oct 2012 18:42:25 +0000 (11:42 -0700)]
Implemented contains operator

12 years agoMerge pull request #34 from dgryski/master
Stephen Dolan [Wed, 24 Oct 2012 09:43:54 +0000 (02:43 -0700)]
Merge pull request #34 from dgryski/master

Add != (not equal) to list of supported binops

12 years agoUpdate generated lexer.gen.* and parser.gen.* files 34/head
Damian Gryski [Wed, 24 Oct 2012 07:31:21 +0000 (09:31 +0200)]
Update generated lexer.gen.* and parser.gen.* files

12 years agoReplace yyscan_t with another pointer type that we control.
Damian Gryski [Wed, 24 Oct 2012 07:28:27 +0000 (09:28 +0200)]
Replace yyscan_t with another pointer type that we control.

This prevents the circuluar dependency between parser.gen.h and
lexer.gen.h.  Newer versions of bison add a prototype for yyparse() to
parser.gen.h that include the as-yet-undeclared yyscan_t type.

12 years agoRemove .gitignore from tarballs.
Stephen Dolan [Tue, 23 Oct 2012 20:58:50 +0000 (21:58 +0100)]
Remove .gitignore from tarballs.

12 years agoAdd some in/equality test cases
Damian Gryski [Tue, 23 Oct 2012 19:12:47 +0000 (21:12 +0200)]
Add some in/equality test cases

12 years agoMerge pull request #22 from alexchamberlain/patch-1
Stephen Dolan [Tue, 23 Oct 2012 18:24:12 +0000 (11:24 -0700)]
Merge pull request #22 from alexchamberlain/patch-1

Arch Packaging docs

12 years agoRegenerate lex/yacc files
Damian Gryski [Tue, 23 Oct 2012 15:02:19 +0000 (17:02 +0200)]
Regenerate lex/yacc files

12 years agoImplement 'not equal' (!=) as a binop
Damian Gryski [Tue, 23 Oct 2012 15:01:39 +0000 (17:01 +0200)]
Implement 'not equal' (!=) as a binop

12 years agoyyscan_t isn't exposed by some versions of flex.
Damian Gryski [Tue, 23 Oct 2012 15:00:42 +0000 (17:00 +0200)]
yyscan_t isn't exposed by some versions of flex.

12 years agoAdd docs for installing on Arch Linux. 22/head
Alex Chamberlain [Tue, 23 Oct 2012 13:46:44 +0000 (14:46 +0100)]
Add docs for installing on Arch Linux.

12 years agoAllow the 'keys' function to take arrays.
Stephen Dolan [Mon, 22 Oct 2012 22:31:07 +0000 (23:31 +0100)]
Allow the 'keys' function to take arrays.

12 years agoI should probably document select and empty :) (#29, #5)
Stephen Dolan [Mon, 22 Oct 2012 22:14:34 +0000 (23:14 +0100)]
I should probably document select and empty :) (#29, #5)

12 years agoDocs fixes.
Stephen Dolan [Mon, 22 Oct 2012 21:56:56 +0000 (22:56 +0100)]
Docs fixes.

 - Mention homebrew on download page (#25)
 - Document 'keys' and string interpolation

12 years agoMerge pull request #14 from merriam/patch-2
Stephen Dolan [Mon, 22 Oct 2012 21:31:04 +0000 (14:31 -0700)]
Merge pull request #14 from merriam/patch-2

Update docs/content/1.tutorial/default.yml

12 years agoDelete a badly-thought-out bit of a Makefile.
Stephen Dolan [Mon, 22 Oct 2012 18:23:57 +0000 (19:23 +0100)]
Delete a badly-thought-out bit of a Makefile.

12 years agoupdated autogenerated files
Stephen Dolan [Mon, 22 Oct 2012 18:18:35 +0000 (19:18 +0100)]
updated autogenerated files

12 years agoSupport a -f option to load from a file, and # comments
Stephen Dolan [Mon, 22 Oct 2012 18:16:27 +0000 (19:16 +0100)]
Support a -f option to load from a file, and # comments

This means '#!/usr/local/bin/jq -f' is now a sensible way
to start a file.

Closes #13

12 years agoFix logic for "slurp" option. Fixes #18
Stephen Dolan [Mon, 22 Oct 2012 17:55:56 +0000 (18:55 +0100)]
Fix logic for "slurp" option. Fixes #18

12 years agoMake the gen_utf8_tables script Python3 compatible (#20)
Stephen Dolan [Mon, 22 Oct 2012 17:47:52 +0000 (18:47 +0100)]
Make the gen_utf8_tables script Python3 compatible (#20)

12 years agoUpdate docs/content/1.tutorial/default.yml 14/head
Charles Merriam [Mon, 22 Oct 2012 09:43:53 +0000 (02:43 -0700)]
Update docs/content/1.tutorial/default.yml

12 years agoVersion number tracking. jq-1.0 jq-1.1
Stephen Dolan [Sun, 21 Oct 2012 22:26:31 +0000 (23:26 +0100)]
Version number tracking.

12 years agoFix a mistake in the docs. Fixes #10
Stephen Dolan [Sun, 21 Oct 2012 21:16:23 +0000 (22:16 +0100)]
Fix a mistake in the docs. Fixes #10

12 years agoMerge pull request #8 from maxme/master
Stephen Dolan [Sun, 21 Oct 2012 19:23:22 +0000 (12:23 -0700)]
Merge pull request #8 from maxme/master

add install and uninstall rules in Makefile

12 years agoUpdate website: binaries + version bump.
Stephen Dolan [Sun, 21 Oct 2012 19:16:26 +0000 (20:16 +0100)]
Update website: binaries + version bump.

12 years agoadd install and uninstall rules in Makefile 8/head
Maxime Biais [Sun, 21 Oct 2012 18:55:50 +0000 (20:55 +0200)]
add install and uninstall rules in Makefile

12 years agoCheck in a bunch of autogenerated files.
Stephen Dolan [Sun, 21 Oct 2012 18:52:16 +0000 (19:52 +0100)]
Check in a bunch of autogenerated files.

These seem not to build with the version of bison, etc. on OS X.
This is a hack for now, I'll fix the OS X build when I get access
to a mac.

12 years agoAdd a 'keys' function. Fixes #4.
Stephen Dolan [Fri, 19 Oct 2012 23:26:37 +0000 (00:26 +0100)]
Add a 'keys' function. Fixes #4.

12 years agoA string interpolation syntax that I don't hate. Also tests.
Stephen Dolan [Fri, 19 Oct 2012 23:09:20 +0000 (00:09 +0100)]
A string interpolation syntax that I don't hate. Also tests.

You can interpolate values into strings using \(this syntax), e.g.

    "best \("str" + "ing") ever"