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

12 years agoMore error handling - locations of refs to undefined symbols.
Stephen Dolan [Tue, 11 Sep 2012 11:24:54 +0000 (12:24 +0100)]
More error handling - locations of refs to undefined symbols.

12 years agoBetter error handling and messages for invalid index/assign operations.
Stephen Dolan [Tue, 11 Sep 2012 09:37:44 +0000 (10:37 +0100)]
Better error handling and messages for invalid index/assign operations.

12 years agoMore error handling in the parser.
Stephen Dolan [Tue, 11 Sep 2012 09:12:25 +0000 (10:12 +0100)]
More error handling in the parser.

Add a special case in the lexer to detect unterminated strings.
Add some error recovery in the parser for more copious error spam.

12 years agoProper error messages from lexer errors (e.g. bad characters).
Stephen Dolan [Tue, 11 Sep 2012 08:13:20 +0000 (09:13 +0100)]
Proper error messages from lexer errors (e.g. bad characters).

12 years agoMuch, much better error reporting from the parser.
Stephen Dolan [Mon, 10 Sep 2012 23:04:47 +0000 (00:04 +0100)]
Much, much better error reporting from the parser.

Getting proper locations through flex/bison was more effort than
was advertised.

12 years ago'==' operator, tests for equality and operator precedence.
Stephen Dolan [Mon, 10 Sep 2012 17:08:00 +0000 (18:08 +0100)]
'==' operator, tests for equality and operator precedence.

12 years agoString -> number conversions with "tonumber".
Stephen Dolan [Mon, 10 Sep 2012 16:08:13 +0000 (17:08 +0100)]
String -> number conversions with "tonumber".

12 years agoMultiplication and division operators.
Stephen Dolan [Mon, 10 Sep 2012 15:57:17 +0000 (16:57 +0100)]
Multiplication and division operators.

It is an error to use these on anything but numbers. Maybe later
implementing python/ruby-style ("a" * 100) might be handy.

12 years agoSubtraction - as expected for numbers, ruby-style set diff for arrays.
Stephen Dolan [Mon, 10 Sep 2012 15:49:25 +0000 (16:49 +0100)]
Subtraction - as expected for numbers, ruby-style set diff for arrays.

12 years agoString concatenation.
Stephen Dolan [Mon, 10 Sep 2012 15:16:39 +0000 (16:16 +0100)]
String concatenation.

12 years agoSensible error messages when a silly addition is performed.
Stephen Dolan [Mon, 10 Sep 2012 15:07:03 +0000 (16:07 +0100)]
Sensible error messages when a silly addition is performed.

Fix a test to no longer perform an invalid addition.

12 years agojv_string_fmt (create printf-formatted JSON strings)
Stephen Dolan [Mon, 10 Sep 2012 15:01:56 +0000 (16:01 +0100)]
jv_string_fmt (create printf-formatted JSON strings)

12 years agoPlug a memory leak in jv_object_merge
Stephen Dolan [Mon, 10 Sep 2012 14:08:39 +0000 (15:08 +0100)]
Plug a memory leak in jv_object_merge

12 years agoMake jv_invalid() first-class values capable of holding an error.
Stephen Dolan [Mon, 10 Sep 2012 14:04:19 +0000 (15:04 +0100)]
Make jv_invalid() first-class values capable of holding an error.

12 years agoWhen comparing two objects for equality, we don't need to recurse
Stephen Dolan [Mon, 10 Sep 2012 12:06:46 +0000 (13:06 +0100)]
When comparing two objects for equality, we don't need to recurse
into e.g. array elements if the two objects are the same array.

12 years agoMake a main program that doesn't spam debugging info.
Stephen Dolan [Mon, 10 Sep 2012 09:23:15 +0000 (10:23 +0100)]
Make a main program that doesn't spam debugging info.

12 years agoMake the '+' operator merge objects.
Stephen Dolan [Sun, 9 Sep 2012 18:17:07 +0000 (19:17 +0100)]
Make the '+' operator merge objects.

12 years agoBugfix for expanding objects.
Stephen Dolan [Sun, 9 Sep 2012 17:09:05 +0000 (18:09 +0100)]
Bugfix for expanding objects.

12 years agoPrint bad number values (Inf,NaN) "correctly".
Stephen Dolan [Sun, 9 Sep 2012 14:35:34 +0000 (15:35 +0100)]
Print bad number values (Inf,NaN) "correctly".

12 years agonull and string literals now exist, so add tests
Stephen Dolan [Thu, 6 Sep 2012 20:44:46 +0000 (21:44 +0100)]
null and string literals now exist, so add tests

12 years agoUTF8 coding utilities and unicode escaping in jv_dump()'d strings.
Stephen Dolan [Thu, 6 Sep 2012 20:36:11 +0000 (21:36 +0100)]
UTF8 coding utilities and unicode escaping in jv_dump()'d strings.

Beyond the Basic Multilingual Plane, dead Cthulhu waits dreaming.

12 years agoMake the test harness not segfault when a test fails (!)
Stephen Dolan [Tue, 4 Sep 2012 19:56:44 +0000 (20:56 +0100)]
Make the test harness not segfault when a test fails (!)

12 years agoAdd a Boolean "not" operator.
Stephen Dolan [Tue, 4 Sep 2012 19:43:40 +0000 (20:43 +0100)]
Add a Boolean "not" operator.

Not wholly convinced this is a good idea, maybe "not" should be a
builtin function instead? 'not (.a == .b)' vs. '.a == .b | not'

12 years agoShort-circuiting Boolean "and" and "or" operators.
Stephen Dolan [Tue, 4 Sep 2012 19:38:59 +0000 (20:38 +0100)]
Short-circuiting Boolean "and" and "or" operators.

12 years agoMove some unicode handling stuff to a separate file.
Stephen Dolan [Tue, 4 Sep 2012 19:34:43 +0000 (20:34 +0100)]
Move some unicode handling stuff to a separate file.

12 years agoAdd "elif" to if-then-else constructs.
Stephen Dolan [Tue, 4 Sep 2012 15:05:24 +0000 (16:05 +0100)]
Add "elif" to if-then-else constructs.

12 years agoif-then-else and defined-or operators
Stephen Dolan [Tue, 4 Sep 2012 14:34:34 +0000 (15:34 +0100)]
if-then-else and defined-or operators

12 years agoFix some confusion between "null" and "invalid".
Stephen Dolan [Mon, 3 Sep 2012 16:26:52 +0000 (17:26 +0100)]
Fix some confusion between "null" and "invalid".

12 years agoFix a memory leak in JV and add more tests
Stephen Dolan [Mon, 3 Sep 2012 16:18:10 +0000 (17:18 +0100)]
Fix a memory leak in JV and add more tests

12 years agoPerl-style autovivification.
Stephen Dolan [Mon, 3 Sep 2012 15:50:38 +0000 (16:50 +0100)]
Perl-style autovivification.

.foo.bar = 1 will cause objects to be created if they don't exist.

12 years agosquash a debug printf
Stephen Dolan [Mon, 3 Sep 2012 15:42:58 +0000 (16:42 +0100)]
squash a debug printf

12 years agoJV_KIND_INVALID values to represent failed lookups, etc + various tests.
Stephen Dolan [Mon, 3 Sep 2012 15:16:14 +0000 (16:16 +0100)]
JV_KIND_INVALID values to represent failed lookups, etc + various tests.

12 years agoSupport "null" in JQ programs
Stephen Dolan [Mon, 3 Sep 2012 15:14:52 +0000 (16:14 +0100)]
Support "null" in JQ programs

12 years agoMake assignment work again: = and |= operators.
Stephen Dolan [Mon, 3 Sep 2012 14:33:59 +0000 (15:33 +0100)]
Make assignment work again: = and |= operators.

12 years agoDisallow a + before numbers (makes parsing easier, agrees with JSON)
Stephen Dolan [Mon, 3 Sep 2012 14:32:50 +0000 (15:32 +0100)]
Disallow a + before numbers (makes parsing easier, agrees with JSON)

12 years agoModify number formatting so that 1e-3 renders as 0.001, not .001
Stephen Dolan [Mon, 3 Sep 2012 12:57:53 +0000 (13:57 +0100)]
Modify number formatting so that 1e-3 renders as 0.001, not .001

12 years agoLiteral strings and better literal numbers.
Stephen Dolan [Mon, 3 Sep 2012 12:36:12 +0000 (13:36 +0100)]
Literal strings and better literal numbers.

12 years agoRemove globals from parser, use explicit structure.
Stephen Dolan [Mon, 3 Sep 2012 00:12:42 +0000 (01:12 +0100)]
Remove globals from parser, use explicit structure.

12 years agoMark a constant array const in jvp_dtoa.c
Stephen Dolan [Sun, 2 Sep 2012 21:24:27 +0000 (22:24 +0100)]
Mark a constant array const in jvp_dtoa.c

12 years agoFix behaviour of stack at program termination.
Stephen Dolan [Sun, 2 Sep 2012 21:08:36 +0000 (22:08 +0100)]
Fix behaviour of stack at program termination.

12 years agoMove from Jansson to JV - proper freeing of memory
Stephen Dolan [Sun, 2 Sep 2012 20:45:27 +0000 (21:45 +0100)]
Move from Jansson to JV - proper freeing of memory

A few more tests, now passes valgrind.

12 years agoClean up build a little and add .gitignore.
Stephen Dolan [Sun, 2 Sep 2012 16:24:17 +0000 (17:24 +0100)]
Clean up build a little and add .gitignore.

12 years agoMove from Jansson to JV - interpreter loop
Stephen Dolan [Sun, 2 Sep 2012 16:20:13 +0000 (17:20 +0100)]
Move from Jansson to JV - interpreter loop

Passes tests, but leaks some memory.

12 years agoMove from Jansson to JV - everything but the interpreter loop
Stephen Dolan [Sun, 2 Sep 2012 15:31:59 +0000 (16:31 +0100)]
Move from Jansson to JV - everything but the interpreter loop

Passes valgrind --leak-check=full.

12 years agoValidation for empty objects
Stephen Dolan [Sat, 1 Sep 2012 23:24:23 +0000 (00:24 +0100)]
Validation for empty objects

Now (correctly) fails to parse {,}

12 years agoFirst pass at a JSON parser
Stephen Dolan [Sat, 1 Sep 2012 18:16:43 +0000 (19:16 +0100)]
First pass at a JSON parser

12 years agoFix a memory leak when inserting into an object with an already-present key
Stephen Dolan [Sat, 1 Sep 2012 17:24:17 +0000 (18:24 +0100)]
Fix a memory leak when inserting into an object with an already-present key

12 years agoMinor changes to dtoa.c to make it easier to work with.
Stephen Dolan [Sat, 1 Sep 2012 16:56:34 +0000 (17:56 +0100)]
Minor changes to dtoa.c to make it easier to work with.

 - Change memory allocation to thread a context structure through
   the code rather than using globals (which would require a
   -lpthread and some locking to become threadsafe).

 - Remove a few configuration options (the "private memory" space,
   and K&R style headers).

 - Prefix exported symbols with jvp_ to prevent libc conflicts.

 - Add jvp_dtoa.h

 - Include netlib's g_fmt.c into dtoa.c

 - Add a few not-strictly-necessary initialisations in order to
   compile cleanly with gcc -Wall

12 years agoImport a copy of David Gay's dtoa.c
Stephen Dolan [Sat, 1 Sep 2012 15:50:25 +0000 (16:50 +0100)]
Import a copy of David Gay's dtoa.c

12 years agoFix a bug in lexical scoping, add tests
Stephen Dolan [Tue, 28 Aug 2012 17:38:30 +0000 (18:38 +0100)]
Fix a bug in lexical scoping, add tests

12 years agoReference-counted copy-on-write JSON library.
Stephen Dolan [Tue, 28 Aug 2012 17:09:43 +0000 (18:09 +0100)]
Reference-counted copy-on-write JSON library.

Comes with tests and, presumably, bugs.

12 years agoRemove syntax distinction between builtin and user calls
Stephen Dolan [Mon, 27 Aug 2012 10:19:42 +0000 (11:19 +0100)]
Remove syntax distinction between builtin and user calls

12 years agofirst pass at assignment
Stephen Dolan [Mon, 27 Aug 2012 09:11:55 +0000 (10:11 +0100)]
first pass at assignment

12 years ago2nd order functions
Stephen Dolan [Sun, 26 Aug 2012 13:25:56 +0000 (14:25 +0100)]
2nd order functions

12 years agoFix a revolting hack
Stephen Dolan [Wed, 22 Aug 2012 18:21:35 +0000 (19:21 +0100)]
Fix a revolting hack

12 years agobugfix for backtracking over RET insns, and a truly evil testcase
Stephen Dolan [Wed, 22 Aug 2012 18:05:53 +0000 (19:05 +0100)]
bugfix for backtracking over RET insns, and a truly evil testcase

12 years agoClosures over variables
Stephen Dolan [Tue, 21 Aug 2012 17:24:38 +0000 (18:24 +0100)]
Closures over variables

12 years agoFirst pass at functions + tests
Stephen Dolan [Tue, 21 Aug 2012 17:14:13 +0000 (18:14 +0100)]
First pass at functions + tests

12 years agoframe layout refactor
Stephen Dolan [Tue, 21 Aug 2012 11:35:36 +0000 (12:35 +0100)]
frame layout refactor

12 years agoStacks grow down now
Stephen [Mon, 20 Aug 2012 14:53:20 +0000 (15:53 +0100)]
Stacks grow down now

12 years agoan addition operator, of sorts
Stephen [Thu, 16 Aug 2012 00:16:08 +0000 (01:16 +0100)]
an addition operator, of sorts

12 years agoMost of a C implementation of jq
Stephen [Thu, 16 Aug 2012 00:00:30 +0000 (01:00 +0100)]
Most of a C implementation of jq

12 years agoinitial
Stephen Dolan [Wed, 18 Jul 2012 19:57:59 +0000 (20:57 +0100)]
initial