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.
* Try making some GitHub Actions
* GHA: Add OS X, Windows, and Linux w/ scan-build builds
* Add link to discord server
Add link to discord server
* Update Ubuntu to 22.04 for GitHub Actions
* Remove if condition for Ubuntu build
* Fix MacOS OS on GitHub Actions
* Fix python3 package on GitHub Actions
* Disalbe valgrind
Getting failed tests: https://github.com/jqlang/jq/actions/runs/5113866588/jobs/9193542140#step:9:341
* Format file
* Fix macos build
* Fix syntax errors of windows build
https://github.com/jqlang/jq/actions/runs/5114162556/workflow
* Install windows package with choco
* Pin oniguruma to 5a24a49d710a9e3bb8ff11d12e1eae5a9f9df40c
MacOS build [fails](https://github.com/jqlang/jq/actions/runs/5114162555/jobs/9194126677#step:6:3160) due to
```
posix.c:94:3: error: implicit declaration of function 'onig_end' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
onig_end();
```
The current `oniguruma` revision
6fa38f4084b448592888ed9ee43c6e90a46b5f5c (15 Mar 2017) lacks the following explicit declaration in src/onigposix.h:
```
ONIG_EXTERN int onig_end P_((void));
```
This was added to oniguruma in revision 5a24a49d710a9e3bb8ff11d12e1eae5a9f9df40c (8 Sep 2017).
Ref: https://github.com/jqlang/jq/issues/2381
* Revert windows build to use pacman
* Don't zip jq.exe
* Fixing windows build
* Update .gitattriutes for eol on Windows
* Skip workflow_dispatch for windows build
* Clean up builds
* Use LF line endings for all text
Ref: https://github.com/actions/checkout/issues/135
* Fix test that has rounding error
https://github.com/jqlang/jq/pull/2596#issuecomment-1568498993
* Enable CI for all
---------
Co-authored-by: Nicolas Williams <nico@cryptonector.com>
When the string transformation to number failed, all following
transformation failed too.
This happend because status in decNumberFromString function is
updated just in error case. Reusing the DEC_CONTEXT that failed
before results into error even if the string is valid number.
Keep a cached copy of the man tests that we can use when no manpage
changes are made. This allows automated systems that might not have
easy access to a pipenv to build and run tests.
Extend jv_number to use decNumber for storing number literals. Any math
operations on the numbers will truncate them to double precision.
Comparisons when both numbers are literal numbers will compare them
without truncation.
Delay conversion of numbers to doubles until a math operation is performed,
to preserve precision. A literal jv_number will only need conversion to
double once, and will reuse the resultant double on subsequent
conversions.
Outputting literal jv_numbers preserves the original precision.
Add strong pthread requirement to manage contexts/allocations for
converting numbers between their decNumber, string, and double formats.
Defaults the else clause to the identity filter "." if an else clause is
missing.
The following two jq programs are considered equivalent:
```
if .foo then
.foo = "bar"
else
.
end
```
```
if .foo then
.foo = "bar"
end
```