summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-04-03Add configure guards around literal jv_numbersdec_literal_numberWilliam Langford
Allow building jq in a mode that doesn't use decnumber for benchmarking purposes. decnumber support is enabled by default, and this option is meant to be removed once we're happy with the performance.
2019-04-03[tests] print test # from the start of the tests file to help with skip and takeLeonid S. Usov
2019-04-03Save literal value of the parsed number to preserve it for the outputLeonid S. Usov
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.
2019-04-03Add decNumber libraryLeonid S. Usov
The library adds support for decimal numbers of arbitrary length. Downloaded from ICU, under ICU 1.8.1 license http://download.icu-project.org/files/decNumber/decNumber-icu-368.zip
2019-03-29Dockerfile: Uninstall oniguruma before distcleanMattias Hansson
Run `make uninstall` for oniguruma before running the recursive distclean that will remove oniguruma's Makefile and cause a build error due to missing make target.
2019-03-29Dockerfile: Fetch dependency as git submoduleMattias Hansson
Fetch oniguruma using git submodule instead of a release tarball. It will fix a build problem, caused by jq's autotools configuration, trying to run `make distclean` recursively in an empty modules directory. This will also improve the maintainability of the Dockerfile.
2019-03-29Dockerfile: Change base image to Debian StableMattias Hansson
2019-03-29Dockerfile: Add missing dependency to pip3Mattias Hansson
2019-03-29Dockerfile: Specify locale settingsMattias Hansson
Avoid RuntimeError in pipenv by setting LC_ALL and LANG to C.UTF-8.
2019-03-29Dockerfile: Set noninteractiveMattias Hansson
Configure the environment to inform debconf that it's running in noninteractive mode, to avoid some warnings.
2019-03-29Add pkg-config file for libjqMattias Hansson
pkg-config is a common interface to resolve build details. It will become easier to incorporate libjq in other projects by providing this interface.
2019-03-26Fix assert in generator subexpressions (fix #1875)Nicolas Williams
Expressions of the form `path(EXPR) | select(GENERATOR)`, where `EXPR` is a path expression and `GENERATOR` is a generator conditional expression (e.g., `has("a"), has("b")`) cause an assertion if the jq_state VM is torn down too soon. That assert() was only correct if assuming that the conditional is not a generator. If the conditional is generator, then what we see is that when backtracking a SUBEXP_END is executed without a corresponding SUBEXP_BEGIN because the entire conditional is bracketed with SUBEXP_BEGIN and SUBEXP_END, and since it's resumed in the middle, in between the brackets. Rather than assert that the jq->path_len being restored has some particular value, we can simply re-compute it from the restored jq->path.
2019-03-25Fix tests/jq.test for c72ed135Nicolas Williams
2019-03-25Fix tests/shtest broken by 2b4d51fNicolas Williams
2019-03-24Disable docs by default; don't mantest if no docsNicolas Williams
2019-03-24Identify progname in more errors (fix #1860)Nicolas Williams
However, we should really use the argv[0] progname, not just jq. Someday we may want to support aliases which automatically add certain options, etc.
2019-03-24Add -b / --binary option for WindowsNicolas Williams
2019-03-24Allow .["foo"].["bar"]Nicolas Williams
2019-03-24Allow keywords in more places (fix #1868)Nicolas Williams
2019-02-26Restore cfunction arity in builtins/0Muh Muhten
Count arguments up-front at definition/invocation instead of doing it at bind time, which comes after generating builtins/0 since e843a4f.
2019-02-26Bind libraries backward for consistent shadowingMuh Muhten
2019-02-26Fix regression on ~/.jq being a directoryMuh Muhten
2019-02-26Fix alpine buildMuh Muhten
2019-02-26Make shtest verbose 2 diag. alpine build failureNicolas Williams
Temporarily(?) make tests/shtest verbose to help diagnose Travis alpine build failures.
2019-02-26Change contains to return true for empty string needlesWilliam Langford
The behavior of memmem for an empty needle is inconsistent between implementations of libc. Our tests imply that we want an empty string needle to be true, so check for an empty needle before calling memmem.
2019-02-26Configure appveyor build to use pythonWilliam Langford
2019-02-26Cleanup leftover references to rubyWilliam Langford
2019-02-26Configure travis build to use pythonWilliam Langford
2019-02-26Remove ruby dependency from mantestsWilliam Langford
2019-02-26Remove ruby dependency from manpage buildWilliam Langford
2019-02-26Remove ruby dependency from website buildWilliam Langford
2019-02-26Simplify and optimize SQLish builtinsMuh Muhten
2019-02-26Fix bizarre bsearch/1 behaviour with a stream argumentMuh Muhten
2019-02-26Make tostream much more efficientMuh Muhten
(`path(.[])` is a streaming `keys`!)
2019-02-26Reimplement fromstream/1 more compactlyMuh Muhten
2019-02-26Simplify definition of range/3Muh Muhten
New implementation in terms of while/2, and branches immediately on $by to avoid checking the sign of $by *in* the loop.
2019-02-26Simplify type-select builtinsMuh Muhten
2019-02-26Add more tests for any and allMuh Muhten
2019-02-26Redefine isempty/1, and the all and any seriesMuh Muhten
Fixes the bug where all and any evaluate one more item than needed.
2019-02-26Remove scalars_or_emptyMuh Muhten
2019-02-26No need to block_drop_unreferenced after builtinsMuh Muhten
(The correctness of this change is more obvious after the rename.)
2019-02-26Rename block_bind_incremental to block_bind_referencedMuh Muhten
block_bind_incremental is block_bind_referenced in a loop backwards. For an 1-inst block, it does the same thing and isn't too much more expensive, so it's not really useful to keep both. Also, block_bind_referenced was a better name for the function.
2019-02-26Fix block flipping in block_drop_unreferencedMuh Muhten
Since 605bfb3, block_drop_unreferenced actually reverses the order of instructions in the block it's run against. This bug was hidden by the fact that normally it's run *twice* against the main program, flipping it back, and that order of function definitionss doesn't really matter after symbol resolution.
2019-02-21Merge pull request #1837 from muhmuhten/limit_0Nico Williams
2019-02-21Ensure limit(0; ...) is emptyMuh Muhten
2019-02-20Rewrite `_assign/2` using `$argument` syntaxMuh Muhten
2019-02-20Work around fgets()'s lack of length reportingMuh Muhten
Stop losing \0s from the end of files because we don't know how much fgets() read into our buffer. If we prefill the buffer with anything other than zeroes, we can actually tell the difference between the terminator and unused space in the buffer. This is possibly more expensive, but at least it should be correct. Fixes #1504
2019-02-20Fix if-then-else example formattingNicolas Williams
2019-02-20Document optional `else` clause of `if`Nicolas Williams
2019-02-20Support "if" without "else" clauseChance Zibolski
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 ```