Commit Graph
32 Commits
Author SHA1 Message Date
pkoppstein 044b38595c NEWS.md - sub and gsub (#2809) 2023-08-02 08:38:27 +09:00
pkoppstein 4d4c17ca6a Simple and efficient implementation of walk/1 (#2795) 2023-08-01 07:54:21 +09:00
pkoppstein 70bbd10b0b NEWS.md: tweaks
correct grammar, add attributions, clarify abs
2023-07-28 17:25:41 -05:00
pkoppstein 336c3deb8a Test negative indices in path expressions 2023-07-28 12:34:26 -05:00
pkoppstein 13fbe98dff manual.yml: remove contingent tests
Also clarify non-prescriptive nature of some tests in jq.test
2023-07-25 23:43:57 -05:00
pkoppstein 7b725378b9 builtin.jq: naive abs/0
manual.yml explains that the def is naive, and mentions fabs, etc.
2023-07-25 23:43:57 -05:00
pkoppstein 8f49600a6b builtin.jq: simpler and faster transpose (#2758) 2023-07-25 09:12:23 +09:00
pkoppstein 3553a9d617 manual.yml: some clarifications plus fixes for markdown bloopers (#2737) 2023-07-21 21:33:03 +09:00
pkoppstein 3ec66c858c manual.yml: revise section on identity, clarifying what is subject to change
Mostly clarifications w.r.t. numbers.

The anomalous behavior of leading minus signs is documented, with an explicit notice that this will probably change.
2023-07-19 22:32:24 -05:00
pkoppstein 07ef97c414 debug/1 (#2710)
* debug/1

This def ensures the output of debug(m1,m2) is kept together.

Closes #2709 #2111 #2112
2023-07-14 00:17:42 +02:00
pkoppstein 8345a8a62b manual.yml: further tweaks re map and map_values
Further tweaks, e.g. i.f.o. explicitness:

`map_values(f)` outputs an array if given an array,
or an object if given an object.
2023-07-10 00:06:58 -05:00
pkoppstein 39cf2fb7a6 manual.yml: further tweaks re map and map_values
A more systematic exposition
2023-07-10 00:06:58 -05:00
pkoppstein d710324ef8 manual.yml: clarify explanation of map_values, including description of new behavior
#2466
2023-07-10 00:06:58 -05:00
pkoppstein c68ad08805 manual.yml: pick(pathexps)
Change formal parameter name
2023-07-05 23:48:31 -05:00
pkoppstein 37225a9a07 builtin.jq: def pick(pathexps):
Change the name of the formal parameter.
2023-07-05 23:48:31 -05:00
pkoppstein 416e8ada7d builtin: add pick(stream)
pick(stream) works on both arrays and objects

Restrictions on the dot-paths are specified in manual.yml

See #2578
2023-07-05 23:48:31 -05:00
pkoppstein 83f375cc83 Revamp sub/3 to resolve most issues with gsub (and sub with "g") (#2641)
The primary purpose of this commit is to rectify most problems with
`gsub` (and also `sub` with the `g` option), in particular fix #1425 ('\b'),
fix #2354 (lookahead), and fix #2532 (regex == `"^(?!cd ).*$|^cd "`).

This commit also partly resolves #2148 and resolves #1206 in that
`gsub` no longer loops infinitely; however, because the new `gsub`
depends critically on `match/2`, the behavior when regex == `""` is
sometimes non-standard.

The documentation has been updated to reflect the fact that `sub`
and `gsub` are intended to be regular in the second argument.

Also, `_nwise/1` has been tweaked to take advantage of TCO.
2023-07-04 07:46:29 +09:00
pkoppstein 3c76a5b3f3 manual.yml: fix references to javascript, and clarify semantics of == (#2645)
remove inaccurate and confusing references to javascript; clarify semantics of ==
2023-07-03 12:35:41 +09:00
pkoppstein d2f1ddbd5a manual.yml - Perl NG (#2614) 2023-06-16 07:59:48 +09:00
pkoppstein 4b4cf789e0 def isempty(g) # Testing 'isempty(empty)' at line number 1364 2017-04-15 16:45:00 -05:00
pkoppstein ad8d1a8cc8 Two sub bugs fixed; two new gsub tests have been added.
./jq --run-tests < tests/onig.test
has been run successfully:

...
Testing 'gsub("a";"b")' at line number 70
Testing 'gsub( "(.*)"; "";  "x")' at line number 74
...
22 of 22 tests passed (0 malformed)
2015-12-09 15:28:01 -06:00
pkoppstein dea7868f01 spelling corrections; untabify 2015-08-11 20:54:03 -07:00
pkoppstein 16d0e528aa walk/1 2015-08-11 20:54:03 -07:00
pkoppstein d66fbd218b Clarify documentation of STRING * INTEGER 2015-08-04 21:40:16 -04:00
pkoppstein 5856a2d2c0 simplify implementation of bsearch to use "until" and avoid "last"; tested 2015-07-24 12:29:20 -07:00
pkoppstein 752e00bc66 transpose/0 for possibly jagged matrices 2014-12-27 18:52:36 -06:00
pkoppstein 00f018a054 bsearch(x) (binary search): builtin.c (tested), with documentation and test case. Always yields an integer (even if input is unsorted); returns (-1 - ix) if x is not in input array. 2014-12-27 18:44:20 -06:00
pkoppstein 56344670f4 ascii_upcase/0 and ascii_downcase/0 2014-12-27 18:38:52 -06:00
pkoppstein 85f0e30c81 fix sub (#586); add gsub/3; add transpose/0.
Signed-off-by: William Langford <wlangfor@gmail.com>
2014-10-06 21:32:07 -04:00
pkoppstein a696c6b551 regex filters (#432): scan, splits, split, sub, gsub 2014-08-08 17:00:14 -05:00
pkoppstein f8fed0f0bc Apply TCO to recurse/1, add recurse/2; tweak docs
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2014-08-04 21:11:01 -05:00
pkoppstein 53993a9942 Add capture; document regular expression filters
Fix #493.
2014-07-28 19:41:21 -05:00