]> granicus.if.org Git - jq/log
jq
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"

12 years agoMerge pull request #6 from stroan/numeric-comparison-binops
Stephen Dolan [Thu, 11 Oct 2012 14:47:42 +0000 (07:47 -0700)]
Merge pull request #6 from stroan/numeric-comparison-binops

Add <,>,<=,>= binops

12 years agoMake comp binops nonassoc 6/head
Stephen Roantree [Wed, 10 Oct 2012 21:44:17 +0000 (22:44 +0100)]
Make comp binops nonassoc

12 years agoAdd <,>,<=,>= binops
Stephen Roantree [Sun, 7 Oct 2012 21:34:12 +0000 (22:34 +0100)]
Add <,>,<=,>= binops

12 years agoAllow underscores in IDENT tokens. Fixes #3.
Stephen Dolan [Sat, 22 Sep 2012 13:03:46 +0000 (14:03 +0100)]
Allow underscores in IDENT tokens. Fixes #3.

IDENT syntax now includes ASCII letters and underscores, so
'.foo_bar' now works. Non-ASCII letters won't work in IDENT
tokens (it's impossible to tell which non-ascii characters are
"letters" without full unicode tables), so '.donnĂ©es' is still
a syntax error (the workaround is '.["donnĂ©es"]', since you can
put anything you like in a string).

12 years agoAdd a bunch of commandline options for controlling I/O format.
Stephen Dolan [Thu, 20 Sep 2012 18:31:14 +0000 (19:31 +0100)]
Add a bunch of commandline options for controlling I/O format.

Also docs for the above. Closes #1.

12 years agoMore broken links :(
Stephen Dolan [Wed, 19 Sep 2012 09:54:58 +0000 (10:54 +0100)]
More broken links :(

12 years agoMake URLs relative to not break on github-pages
Stephen Dolan [Wed, 19 Sep 2012 09:48:23 +0000 (10:48 +0100)]
Make URLs relative to not break on github-pages

12 years agoMake the <title>s of the doc pages less messy.
Stephen Dolan [Wed, 19 Sep 2012 00:15:49 +0000 (01:15 +0100)]
Make the <title>s of the doc pages less messy.

12 years agoNo HTTPS for me, sadly.
Stephen Dolan [Wed, 19 Sep 2012 00:12:33 +0000 (01:12 +0100)]
No HTTPS for me, sadly.

12 years agoFix some issues with relative URLs on Github Pages.
Stephen Dolan [Wed, 19 Sep 2012 00:10:47 +0000 (01:10 +0100)]
Fix some issues with relative URLs on Github Pages.

12 years agoAdd a rake task to compile docs into static html.
Stephen Dolan [Wed, 19 Sep 2012 00:03:05 +0000 (01:03 +0100)]
Add a rake task to compile docs into static html.

12 years agoUse a theme from Bootswatch for docs.
Stephen Dolan [Wed, 19 Sep 2012 00:00:25 +0000 (01:00 +0100)]
Use a theme from Bootswatch for docs.

12 years agoEnsure 'make tarball' creates the required directories.
Stephen Dolan [Tue, 18 Sep 2012 23:36:37 +0000 (00:36 +0100)]
Ensure 'make tarball' creates the required directories.

12 years agoAdd some release stuff to Makefile.
Stephen Dolan [Tue, 18 Sep 2012 23:34:49 +0000 (00:34 +0100)]
Add some release stuff to Makefile.

12 years agoAdd binaries and update download docs.
Stephen Dolan [Tue, 18 Sep 2012 23:08:02 +0000 (00:08 +0100)]
Add binaries and update download docs.

12 years agoInitialise some variables to keep gcc happy.
Stephen Dolan [Tue, 18 Sep 2012 22:46:23 +0000 (23:46 +0100)]
Initialise some variables to keep gcc happy.

12 years agoFix a parsing bug for \uXXXX escapes (some invalid escapes were accepted).
Stephen Dolan [Tue, 18 Sep 2012 22:45:30 +0000 (23:45 +0100)]
Fix a parsing bug for \uXXXX escapes (some invalid escapes were accepted).

Found by gcc -O -Wall identifying a use of uninitialised variables.

12 years agoAdd a README
Stephen Dolan [Tue, 18 Sep 2012 22:40:19 +0000 (23:40 +0100)]
Add a README

12 years agoUsage messages if jq is run with no arguments.
Stephen Dolan [Tue, 18 Sep 2012 22:37:46 +0000 (23:37 +0100)]
Usage messages if jq is run with no arguments.

Beats segfaulting.

12 years agoImplement the 'add' builtin promised by the docs' examples.
Stephen Dolan [Tue, 18 Sep 2012 22:32:24 +0000 (23:32 +0100)]
Implement the 'add' builtin promised by the docs' examples.

12 years agoMore docs + docs cleanup
Stephen Dolan [Tue, 18 Sep 2012 22:17:27 +0000 (23:17 +0100)]
More docs + docs cleanup

12 years agoPrint Unicode characters unescaped by default.
Stephen Dolan [Tue, 18 Sep 2012 21:47:19 +0000 (22:47 +0100)]
Print Unicode characters unescaped by default.

12 years agoSeparate the tests and the main program.
Stephen Dolan [Tue, 18 Sep 2012 21:17:13 +0000 (22:17 +0100)]
Separate the tests and the main program.

12 years agoAdd a COPYING file with too many words in it.
Stephen Dolan [Tue, 18 Sep 2012 16:59:09 +0000 (17:59 +0100)]
Add a COPYING file with too many words in it.

12 years agoDocumentation. Copious.
Stephen Dolan [Tue, 18 Sep 2012 16:51:53 +0000 (17:51 +0100)]
Documentation. Copious.

12 years agoMove everything around - delete old Haskell code, clean up build.
Stephen Dolan [Tue, 18 Sep 2012 16:44:43 +0000 (17:44 +0100)]
Move everything around - delete old Haskell code, clean up build.

12 years agoSlightly better string interpolation.
Stephen Dolan [Tue, 18 Sep 2012 12:22:22 +0000 (13:22 +0100)]
Slightly better string interpolation.

12 years agoAdd the builtin 'select' function.
Stephen Dolan [Tue, 18 Sep 2012 11:58:39 +0000 (12:58 +0100)]
Add the builtin 'select' function.

12 years agoAdd a missing file from prev commit
Stephen Dolan [Tue, 18 Sep 2012 11:58:29 +0000 (12:58 +0100)]
Add a missing file from prev commit

12 years agoBuiltin functions defined in jq.
Stephen Dolan [Tue, 18 Sep 2012 09:17:38 +0000 (10:17 +0100)]
Builtin functions defined in jq.

12 years ago-Werror was a little overzealous.
Stephen Dolan [Tue, 18 Sep 2012 08:43:44 +0000 (09:43 +0100)]
-Werror was a little overzealous.

Older versions of gcc warn about random things. -Werror makes the
built fail on such compilers.

12 years agoBuiltin function 'type'.
Stephen Dolan [Mon, 17 Sep 2012 22:06:48 +0000 (23:06 +0100)]
Builtin function 'type'.

12 years agoFix a precedence bug.
Stephen Dolan [Mon, 17 Sep 2012 21:37:51 +0000 (22:37 +0100)]
Fix a precedence bug.

a == b or c == d should obviously parse as (a==b) or (c==d).

12 years agoRecursive functions + bugfix for stack reallocation.
Stephen Dolan [Mon, 17 Sep 2012 21:32:06 +0000 (22:32 +0100)]
Recursive functions + bugfix for stack reallocation.

12 years agoMake the code compile with warnings-as-errors.
Stephen Dolan [Mon, 17 Sep 2012 21:04:32 +0000 (22:04 +0100)]
Make the code compile with warnings-as-errors.

-Wextra found a bona-fide bug: signed/unsigned comparison in a
stack overflow check.

12 years agoFix debugging code in execute.c so that debug jq compiles again.
Stephen Dolan [Mon, 17 Sep 2012 20:43:10 +0000 (21:43 +0100)]
Fix debugging code in execute.c so that debug jq compiles again.

12 years agoMake "not" a builtin function rather than syntax.
Stephen Dolan [Mon, 17 Sep 2012 20:08:43 +0000 (21:08 +0100)]
Make "not" a builtin function rather than syntax.

Fixes a really awkward grammar issue.

12 years agoRedefine true and false. Define empty, distict from null.
Stephen Dolan [Mon, 17 Sep 2012 19:59:34 +0000 (20:59 +0100)]
Redefine true and false. Define empty, distict from null.

This might be the most philosophical commit. I shall ponder it.

true, false, null, empty now defined as bytecoded builtins rather
than calls out to C functions.

12 years agoMerge branch 'master' of github:stedolan/jq
Stephen Dolan [Mon, 17 Sep 2012 19:46:13 +0000 (20:46 +0100)]
Merge branch 'master' of github:stedolan/jq

Conflicts:
c/builtin.c

12 years agoFirst pass at string interpolation.
Stephen Dolan [Mon, 17 Sep 2012 19:41:57 +0000 (20:41 +0100)]
First pass at string interpolation.

Requires a lexer hack, but a surprisingly un-hideous one. The lexer
maintains a stack of bracket characters so that it can match
parens/brackets/braces to tell where a subexp nested in a string
actually ends.

12 years agoAdd a "tostring" function.
Stephen Dolan [Mon, 17 Sep 2012 19:14:07 +0000 (20:14 +0100)]
Add a "tostring" function.

12 years agoSupport rendering a JSON value to a string buffer.
Stephen Dolan [Mon, 17 Sep 2012 19:08:55 +0000 (20:08 +0100)]
Support rendering a JSON value to a string buffer.

12 years agoBetter support for appending strings in JV.
Stephen Dolan [Mon, 17 Sep 2012 18:41:41 +0000 (19:41 +0100)]
Better support for appending strings in JV.

12 years agoBind builtin functions in a slightly less ugly way.
Stephen Dolan [Sun, 16 Sep 2012 16:08:56 +0000 (17:08 +0100)]
Bind builtin functions in a slightly less ugly way.

12 years agoBuiltin function 'length', for arrays/objects/strings.
Stephen Dolan [Sun, 16 Sep 2012 10:08:42 +0000 (11:08 +0100)]
Builtin function 'length', for arrays/objects/strings.

12 years agoHrm. Update operators (//=, +=, etc.) aren't very well thought out.
Stephen Dolan [Sun, 16 Sep 2012 10:07:36 +0000 (11:07 +0100)]
Hrm. Update operators (//=, +=, etc.) aren't very well thought out.

In complex cases, their behaviour is kinda weird. Here's a failing
test for what I think they should do.

12 years agoAdd update operators (+=, -=, *=, /= and //=)
Stephen Dolan [Tue, 11 Sep 2012 22:55:59 +0000 (23:55 +0100)]
Add update operators (+=, -=, *=, /= and //=)

12 years agoMake .[] capable of iteration over objects as well as arrays.
Stephen Dolan [Tue, 11 Sep 2012 15:10:55 +0000 (16:10 +0100)]
Make .[] capable of iteration over objects as well as arrays.

Also change an assert to a proper error message if it's given
something silly like a number.

12 years agoPretty-printing of JSON values.
Stephen Dolan [Tue, 11 Sep 2012 14:51:12 +0000 (15:51 +0100)]
Pretty-printing of JSON values.

12 years agoJSON stream parser.
Stephen Dolan [Tue, 11 Sep 2012 13:52:10 +0000 (14:52 +0100)]
JSON stream parser.

Allow multiple values on input as concatenated JSON objects,
possibly separated by whitespace.