d0ca11d665
Add support for negative indices for .[]; fix #462
...
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2014-07-06 01:40:22 -05:00
7ee3b724d1
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.
2014-06-17 17:00:23 -05:00
1dbe9317bc
Add indices(s)
, improve index(s)
, rindex(s)
...
Now these deal with arrays as input and `s` being an array or a scalar.
2014-06-08 02:01:44 -05:00
5412f3f1c1
convert range bounds to integers in a way that avoids undefined behaviour
2013-12-10 09:20:13 +00:00
014b45b4a9
add checking of numeric indices to an array to see if they can reasonably be considered integers. Avoid undefined behaviour if out of bounds
2013-12-10 09:20:12 +00:00
cac14a531d
Add index strings by string; return string indexes
...
% jq '.[","]'
"a,bc,def,ghij,klmno"
[1,4,8,13]
%
2013-12-04 18:21:42 -06:00
884e6c7d8b
Add string slicing
2013-12-04 18:21:39 -06:00
8d4748c8df
Fix a crash on group_by of empty list. Fixes #208 .
2013-11-07 12:18:48 +00:00
37cfc912c1
Remove #includes from jv.h
2013-06-23 14:23:07 +01:00
298b2a6033
Add libjq autoconf goo
2013-06-21 11:57:12 -05:00
e83e51eb56
'length' function now measures string length in codepoints, not bytes.
2013-05-15 00:37:38 +01:00
c496a924ce
Bugfix for array slices.
2013-05-15 00:22:44 +01:00
33901b74b1
Array slicing. Closes #2 .
2013-05-13 20:16:19 +01:00
48be23233a
Add the "has" function. Closes #74 .
2013-05-06 13:46:54 +01:00
fb84541e11
Clean up jv_object_foreach and add jv_array_foreach
2012-12-31 23:27:00 +00:00
465a4ec565
Improvements to del(foo).
...
del(foo,bar) is now very different from del(foo),del(bar).
See #37 .
2012-12-29 16:13:06 +00:00
79c9c418c6
Path manipulation (path/getpath/setpath/delpath) and docs.
...
del function should fix #37 .
2012-12-28 16:08:29 +00:00
04daafbde3
Add wrappers for malloc/realloc/free. See #43 .
2012-12-18 16:53:51 +00:00
9e743d517a
Sort function and more general comparison operators.
2012-11-30 20:27:16 +00:00
d56370f734
Move some higher-level JSON manipulation functions into jv_aux.{c,h}
2012-11-26 22:22:45 +00:00