1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

66 Commits

Author SHA1 Message Date
1ba8c2cfa6 Add module directive, modulemeta builtin
Fix #425.
2014-08-14 03:26:26 -05:00
9f13afa20f Add jq_report_error() function; use it
Put a stop to fprintf(stderr, ...) where we shouldn't.
2014-08-14 03:21:35 -05:00
c321c3b86b Constant fold objects 2014-08-09 20:47:03 -05:00
8a561120c4 More constant folding: null, true, and false
A step towards doing constant folding for arrays and objects.
2014-08-09 19:15:50 -05:00
8cddb7c681 Allow any number of jq-coded function arguments 2014-08-09 12:42:39 -05:00
32c08d48f3 Add def f($arg): syntax (fix #524) 2014-08-08 19:16:01 -05:00
0d437e25de Better error msg for bad shell quoting (fix #538) 2014-08-06 17:51:53 -05:00
a25950a58c Remove duplicate TOP insertions, drop unused defs. 2014-08-05 00:46:10 -04:00
2e2538ccb8 Fold constants (fix #504) 2014-07-27 17:48:49 -05:00
10f5a3448d Do fix remaining bison warning (fix #433) 2014-07-22 22:51:11 -05:00
38b939688a Added library system with -l, -L, and JQ_LIBRARY_PATH
Created util.[ch] to hold common utilities.
2014-07-22 22:51:11 -05:00
8c3d503d54 Fix bison empty rule warnings (#433, partial fix) 2014-07-14 16:41:48 -05:00
2bb9fc5dda Fix #484, try/catch syntax has conflicts 2014-07-14 16:41:48 -05:00
c38e5b1b2c Lib defs don't bind to each other; fix #479 again 2014-07-13 18:36:27 -05:00
5be80b81eb Add foreach EXP as $var (INIT; UPDATE) form 2014-07-09 00:43:06 -05:00
8780bc0b8e Better check for lib has only functions (fix #138) 2014-07-07 16:03:32 -05:00
5a863bf010 Add foreach and limit 2014-07-06 19:40:05 -05:00
7d3a44a1e2 Add general ? operator 2014-07-06 01:29:43 -05:00
7fce34292e Add try EXP catch EXP 2014-07-06 01:29:42 -05:00
dde43f796e Simplified standard library
Close #426.

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2014-06-17 18:17:50 -05:00
fe29d3d3fa Add ?, .[]?, and .. operators
Make XPath-like `//a/b` recursive structure traversal easier in jq,
which then becomes:

    ..|.a?.b?

The `?` operator suppresses errors about . not being an array or object.
The `..` operator is equivalent to calling the new `recurse_down`
built-in, which in turn is equivalent to

    recurse(.[]?)

Note that `..a` is not supported; neither is `...a`.  That could be add
added, but it doesn't seem worth the trouble of saving the need to type
a '|'.
2014-02-20 15:33:07 -06:00
18e828f17c Allow negated object values without parens. Fixes #247 2013-12-17 22:28:31 +00:00
474386a1d9 Complete more-arity feature not complete
And test
2013-12-11 14:14:26 -06:00
1fc5656762 Support more arguments for defs 2013-12-04 18:21:38 -06:00
9e53f36a74 Fix typo on error message 2013-10-06 17:52:04 +02:00
dae2422fd1 Merge branch 'libjq'
Conflicts:
	Makefile.am
	configure.ac
2013-09-14 19:30:39 +01:00
37cfc912c1 Remove #includes from jv.h 2013-06-23 14:23:07 +01:00
3403d07912 Add mod (and setmod) operators 2013-06-21 15:27:34 -05:00
824ce76cec Simplify block functions for variables 2013-06-18 01:07:18 +01:00
81e2336ace Support ."foo" syntax for accessing fields. See #141. 2013-06-11 22:26:39 +01:00
2ffbb9d6b7 Lex and parse .foo better.
'.as' is now valid, '. foo' is now invalid. See #141.
2013-06-05 13:41:56 +01:00
2c4ccd122e Better error handling for .foo case in parser. See #141. 2013-06-03 23:12:31 +01:00
b90ae078b8 Let the parser rather than the lexer handle invalid characters. 2013-06-03 23:12:31 +01:00
bc42812715 Remove the insane "fold" operation, replace with saner "reduce". 2013-05-16 15:07:53 +01:00
33901b74b1 Array slicing. Closes #2. 2013-05-13 20:16:19 +01:00
d8706fd460 Fix the //= operator.
Closes #62.
2013-05-13 16:04:30 +01:00
2363246eea Merge remote-tracking branch 'stagrlee/master' into autotools
Conflicts:
	Makefile
	jq_test.c
2013-05-08 00:52:24 +01:00
5be97463ec Add a --arg option to allow variables to be passed from the cmdline.
Closes #107
2013-05-06 14:21:00 +01:00
c7725a8d4d merging upstream stedolan changes 2013-02-02 20:39:23 -06:00
925ec3751f Fix negative number syntax. Add a unary '-' operator.
Closes #63.
2013-01-03 12:53:23 +00:00
d5fdf70434 Refactor assignment.
New version is much more elegant and probably slower. Uses
library functions implemented in jq rather than dedicated opcodes.
2012-12-29 16:43:36 +00:00
f1e23448e7 Support for two-argument functions.
Should probably support n args instead. This is a quick hack.
Also, ';' is a slightly ugly argument separator.
2012-12-28 15:07:27 +00:00
417899f9a0 Fold operation (code/docs/test) 2012-12-28 15:05:34 +00:00
89e26969ae @foo syntax for encoding of strings into various formats.
Fixes part of #47 and #48.
2012-12-28 01:23:09 +00:00
04daafbde3 Add wrappers for malloc/realloc/free. See #43. 2012-12-18 16:53:51 +00:00
84026f0513 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]'.
2012-12-07 00:28:11 +00:00
616e8f9924 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.
2012-12-04 00:39:21 +00:00
a88d53d2fd Extend {foo} syntax to allow {"foo"} as well.
Useful when "foo" contains unusual characters. Should help with
the issues #7, #38, #40, #42.
2012-12-03 20:31:40 +00:00
5f6a95c7b5 General cleanup - rename a few things, delete dead code. 2012-12-03 20:02:02 +00:00
ed7f95a492 Demote "contains" to a built-in function rather than an operator. 2012-12-02 22:52:38 +00:00