Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destructure alt #2

Open
wants to merge 164 commits into
base: master
Choose a base branch
from

Commits on Nov 12, 2018

  1. Configuration menu
    Copy the full SHA
    0ab7103 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2018

  1. Merge pull request jqlang#1768 from haochenx/readme-add-automake-as-b…

    …uild-dependency-in
    
    add automake as build dependency to README.md
    wtlangford authored Nov 20, 2018
    Configuration menu
    Copy the full SHA
    bb87e6e View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2018

  1. Fix grammar typo.

    'operator' needs to be plural here.
    dooglus authored Nov 29, 2018
    Configuration menu
    Copy the full SHA
    9caa1ba View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2018

  1. Allow variable refs as object keys {$key:value}

    Users are often surprised by the requirement to parenthesize any
    non-trivial object key expressions in object constructors.  E.g.,
    {"a"+"b":1}.  This commit adds one more kind of key expression besides
    literals and idents: variable references.
    
    A common use case for this is jq programs as JSON templates to fill in
    with variables computed from inputs or passed in on the command-line.
    E.g., {some_key:$value}.  Now users can also use, e.g., {$key:$value}.
    
    This and the restrictions on key and value expressions in object
    constructors are now clarified a bit in the documentation.
    nicowilliams committed Dec 11, 2018
    Configuration menu
    Copy the full SHA
    8ea4a55 View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2018

  1. Configuration menu
    Copy the full SHA
    2760fd3 View commit details
    Browse the repository at this point in the history
  2. Merge pull request jqlang#1779 from gvangool/update-NEWS

    Adds the release info for 1.6 to NEWS
    wtlangford authored Dec 15, 2018
    Configuration menu
    Copy the full SHA
    9c029f7 View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2018

  1. Ensure that ${builddir}/src exists

    pjw91 authored and nicowilliams committed Dec 18, 2018
    Configuration menu
    Copy the full SHA
    7123309 View commit details
    Browse the repository at this point in the history
  2. fix --exit-code issues jqlang#1142 and jqlang#1139

    * Set default error code to -4 in main(), Fixes jqlang#1142
    * fix --exit-code with more than one object in input, Fixes jqlang#1139
        - Return code 1 or 4 based on last output, not last input.
    ryo1kato authored and nicowilliams committed Dec 18, 2018
    Configuration menu
    Copy the full SHA
    6d3d275 View commit details
    Browse the repository at this point in the history
  3. Make fromstream/1 more efficient

    Eugen authored and nicowilliams committed Dec 18, 2018
    Configuration menu
    Copy the full SHA
    fb1c635 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2018

  1. Mingw-w64 on windows doesn't have setenv, fix that.

    Signed-off-by: HE, Tao <[email protected]>
    sighingnow authored and nicowilliams committed Dec 19, 2018
    Configuration menu
    Copy the full SHA
    b436156 View commit details
    Browse the repository at this point in the history

Commits on Dec 26, 2018

  1. Makefile.am: add no-undefined for win32

    "Undefined symbols are not allowed in x86_64-w64-mingw32 shared libraries"
    
    This was also applied in the official MINGW-packages repo:
    Alexpux/MINGW-packages@b5566c58a
    wiiaboo committed Dec 26, 2018
    Configuration menu
    Copy the full SHA
    6893284 View commit details
    Browse the repository at this point in the history
  2. builtin: add missing windows.h include

    Follow-up fix to b436156 because BOOL and DWORD
    are not built-in to mingw64.
    wiiaboo authored and nicowilliams committed Dec 26, 2018
    Configuration menu
    Copy the full SHA
    b10878f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0bc7708 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2019

  1. Merge pull request jqlang#1774 from dooglus/patch-1

    Fix grammar typo.
    wtlangford authored Jan 5, 2019
    Configuration menu
    Copy the full SHA
    4b4fefa View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2019

  1. Configuration menu
    Copy the full SHA
    61cd6db View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2019

  1. Configuration menu
    Copy the full SHA
    63ba2b1 View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2019

  1. Configuration menu
    Copy the full SHA
    12a628a View commit details
    Browse the repository at this point in the history
  2. Fix build on BSD make

    Replace uses of the nonstandard $^ variable by explicitly specifying the
    source filenames. This is the only obvious thing preventing the build
    from running correctly on non-GNU make.
    muhmuhten authored and nicowilliams committed Jan 30, 2019
    Configuration menu
    Copy the full SHA
    012af21 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2019

  1. Unify timegm fallbacks into my_mktime

    my_timegm was introduced in 1900c7 to add a mktime fallback used in
    4a6241, the subsequently removed in c53823. As a result of this code
    shuffling, the jq mktime function (f_mktime) wound up using a fallback
    even on systems where timegm is available, with incorrect results in
    some time zones with DST, e.g.
    
    % TZ=America/New_York jq -n '"2018-08-31T00:00:00Z"|fromdate|todate'
    "2018-08-31T01:00:00Z"
    
    This undoes 1900c7 and moves the workaround it added into the #else of
    my_mktime.
    muhmuhten authored and nicowilliams committed Jan 31, 2019
    Configuration menu
    Copy the full SHA
    3c5b141 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2019

  1. Configuration menu
    Copy the full SHA
    d29bf5b View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2019

  1. builtin/f_match: prevent overruns of input_string

    If these values do not match exactly, it is because the UTF-8 is invalid
    anyway and we counted codepoints differently than oniguruma did.  Perhaps it
    would be better to error out here, but at least one similar loop already
    uses < vs != and since we're off the rails anyway this might be OK.  It is
    certainly better than overruning the buffer.
    
    Resolves jqlang#1804
    pallas authored and nicowilliams committed Feb 4, 2019
    Configuration menu
    Copy the full SHA
    21be385 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2019

  1. Export input/0 directly from C, removing _input/0

    The distinction between input/0 and _input/0 has been unnecessary since
    a9c613..7dc34b, which moved end-of-input handling into C and replaced
    the jq definition of input with `def input: _input;`
    muhmuhten authored and nicowilliams committed Feb 6, 2019
    Configuration menu
    Copy the full SHA
    2fd7252 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2019

  1. Define error/1 in terms of error/0

    The parser generates a call to error/0 on break. Having that exported
    from C directly removes a language dependency on builtin.jq.
    
    In any case, error/0 seems to be the more fundamental operation, seeing
    as the old C impementation of error/1 did nothing useful with its input.
    muhmuhten authored and nicowilliams committed Feb 7, 2019
    Configuration menu
    Copy the full SHA
    956d40d View commit details
    Browse the repository at this point in the history
  2. FIX if-then-else example

    "(.+)" doesn't match new line characters so the link generated for [if-then-else](https://github.com/stedolan/jq/blob/90bc29c1b544c0436ec44246e180fdbb6d6384df/docs/content/3.manual/v1.5/manual.yml#L1804) doesn't work
    mattclegg authored and nicowilliams committed Feb 7, 2019
    Configuration menu
    Copy the full SHA
    18ac789 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2019

  1. Configuration menu
    Copy the full SHA
    2660b04 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    88613f5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3f59bee View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9fa2e51 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2019

  1. Configuration menu
    Copy the full SHA
    605bfb3 View commit details
    Browse the repository at this point in the history
  2. Possibly enable color output on Windows (jqlang#1494)

    Windows 10 supports color output, but it must be explicitly enabled;
    ANSICON provides support for other versions.  Enable color if either of
    those are available.  Resolves jqlang#1494.
    adoxa authored and nicowilliams committed Feb 17, 2019
    Configuration menu
    Copy the full SHA
    def42a3 View commit details
    Browse the repository at this point in the history
  3. Prevent redirecting to NUL crash

    Windows regards the `NUL` device as tty, which causes `WriteFile` to
    fail (the bytes written pointer cannot be `NULL` in this case).  Tweak
    the color test to ensure tty is accurate.
    adoxa authored and nicowilliams committed Feb 17, 2019
    Configuration menu
    Copy the full SHA
    87594f8 View commit details
    Browse the repository at this point in the history
  4. Add ISO 8601-specific strptime

    Implement `strptime` for systems lacking it, but only supporting the
    ISO 8601 format string.
    adoxa authored and nicowilliams committed Feb 17, 2019
    Configuration menu
    Copy the full SHA
    0fc8200 View commit details
    Browse the repository at this point in the history
  5. Make UTC time on Windows

    Windows has `_mkgmtime` for the UTC equivalent of `mktime`.
    adoxa authored and nicowilliams committed Feb 17, 2019
    Configuration menu
    Copy the full SHA
    80b064f View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2019

  1. Allow globbing on Windows

    The mingw-w64 runtime expands wildcards, which causes a discrepancy
    between `main`'s `argv` (multiple file names) and Windows' `wargv` (a
    single wildcard).  Use `wmain` to retrieve the wide character args.
    adoxa authored and nicowilliams committed Feb 18, 2019
    Configuration menu
    Copy the full SHA
    88e1f59 View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2019

  1. Configuration menu
    Copy the full SHA
    8edf58a View commit details
    Browse the repository at this point in the history
  2. Pass on the error message when rel_path is invalid

    "Module path must be a string" is not a useful error message when the
    reason the module path isn't a string is because the string it was got
    replaced with an invalid with an error message for some other reason.
    
    Also fixes a few memory leaks on early exits.
    muhmuhten authored and nicowilliams committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    ff01482 View commit details
    Browse the repository at this point in the history
  3. Catch .. as the first component of a module path

    Only the second and subsequent path components were being checked, which
    I guess is theoretically security-relevant.
    
    There's no apparent point to reconstructing the path after splitting it
    by adding /s back in, either.
    muhmuhten authored and nicowilliams committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    4f4494c View commit details
    Browse the repository at this point in the history
  4. Replace TOP-before-imports special case with assert

    The case isn't actually possible afaict.
    muhmuhten authored and nicowilliams committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    c814c4e View commit details
    Browse the repository at this point in the history
  5. Add import metadata key "optional"

    A library marked is imported if found, but silently skipped if missing.
    This is the desired semantic for the auto-include at ~/.jq
    muhmuhten authored and nicowilliams committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    450ade4 View commit details
    Browse the repository at this point in the history
  6. Load ~/.jq as a library instead of with builtins

    Remove the special code which loads ~/.jq in builtin.c, and instead glue
    an optional include which points to the same file onto the main program
    in linker.c.
    
    Fixes a minor bug where errors in ~/.jq would be labelled <builtin>.
    muhmuhten authored and nicowilliams committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    b2b0bd3 View commit details
    Browse the repository at this point in the history
  7. Make builtin binding fast again by binding only referenced symbols

    Avoid doing the internal binding of top-level symbols in the parser,
    leaving that work to be done in a post-processing step. For builtins,
    this lets us do a reference-aware bind step (block_bind_incremental)
    *after* generating builtins/0.
    
    Libraries are a bit trickier since they may be bound multiple times, so
    instead of thinking through the implications I added (block_bind_self)
    to resolve all internal symbols immediately.
    muhmuhten authored and nicowilliams committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    e843a4f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1ef90ac View commit details
    Browse the repository at this point in the history
  9. Support "if" without "else" clause

    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
    ```
    Chance Zibolski authored and nicowilliams committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    4f6045a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    8a02b2c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    048acee View commit details
    Browse the repository at this point in the history
  12. Work around fgets()'s lack of length reporting

    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 jqlang#1504
    muhmuhten authored and nicowilliams committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    85caac4 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    730c730 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    130152a View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    9a0d5be View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2019

  1. Fix block flipping in block_drop_unreferenced

    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.
    muhmuhten authored and nicowilliams committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    8537b93 View commit details
    Browse the repository at this point in the history
  2. Rename block_bind_incremental to block_bind_referenced

    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.
    muhmuhten authored and nicowilliams committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    260879a View commit details
    Browse the repository at this point in the history
  3. No need to block_drop_unreferenced after builtins

    (The correctness of this change is more obvious after the rename.)
    muhmuhten authored and nicowilliams committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    36c250a View commit details
    Browse the repository at this point in the history
  4. Remove scalars_or_empty

    muhmuhten authored and nicowilliams committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    6a0bdf6 View commit details
    Browse the repository at this point in the history
  5. Redefine isempty/1, and the all and any series

    Fixes the bug where all and any evaluate one more item than needed.
    muhmuhten authored and nicowilliams committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    41b8593 View commit details
    Browse the repository at this point in the history
  6. Add more tests for any and all

    muhmuhten authored and nicowilliams committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    d3abe3a View commit details
    Browse the repository at this point in the history
  7. Simplify type-select builtins

    muhmuhten authored and nicowilliams committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    78271b1 View commit details
    Browse the repository at this point in the history
  8. Simplify definition of range/3

    New implementation in terms of while/2, and branches immediately on $by
    to avoid checking the sign of $by *in* the loop.
    muhmuhten authored and nicowilliams committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    fc6df0f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8c1e717 View commit details
    Browse the repository at this point in the history
  10. Make tostream much more efficient

    (`path(.[])` is a streaming `keys`!)
    muhmuhten authored and nicowilliams committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    d1a07cb View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a1626ad View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    76e72a3 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    c1f1185 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    175dbc4 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    53a3f47 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    15be4e7 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    a4756fd View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    cc724f1 View commit details
    Browse the repository at this point in the history
  19. Change contains to return true for empty string needles

    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.
    wtlangford authored and nicowilliams committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    f951d02 View commit details
    Browse the repository at this point in the history
  20. Make shtest verbose 2 diag. alpine build failure

    Temporarily(?) make tests/shtest verbose to help diagnose Travis alpine
    build failures.
    nicowilliams committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    6df393c View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2019

  1. Fix alpine build

    muhmuhten authored and nicowilliams committed Feb 27, 2019
    Configuration menu
    Copy the full SHA
    30afc86 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    141bb78 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    abed751 View commit details
    Browse the repository at this point in the history
  4. Restore cfunction arity in builtins/0

    Count arguments up-front at definition/invocation instead of doing it at
    bind time, which comes after generating builtins/0 since e843a4f.
    muhmuhten authored and nicowilliams committed Feb 27, 2019
    Configuration menu
    Copy the full SHA
    3ea0199 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2019

  1. Configuration menu
    Copy the full SHA
    c72ed13 View commit details
    Browse the repository at this point in the history
  2. Allow .["foo"].["bar"]

    nicowilliams committed Mar 25, 2019
    Configuration menu
    Copy the full SHA
    3e0a118 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0dab2b1 View commit details
    Browse the repository at this point in the history
  4. Identify progname in more errors (fix jqlang#1860)

    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.
    nicowilliams committed Mar 25, 2019
    Configuration menu
    Copy the full SHA
    2b4d51f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dffba62 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e01398c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b34af08 View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2019

  1. Fix assert in generator subexpressions (fix jqlang#1875)

    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.
    nicowilliams committed Mar 26, 2019
    Configuration menu
    Copy the full SHA
    b52fc10 View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2019

  1. Add pkg-config file for libjq

    pkg-config is a common interface to resolve build details. It will
    become easier to incorporate libjq in other projects by providing this
    interface.
    orzen authored and nicowilliams committed Mar 29, 2019
    Configuration menu
    Copy the full SHA
    3c4fcb1 View commit details
    Browse the repository at this point in the history
  2. Dockerfile: Set noninteractive

    Configure the environment to inform debconf that it's running in
    noninteractive mode, to avoid some warnings.
    orzen authored and nicowilliams committed Mar 29, 2019
    Configuration menu
    Copy the full SHA
    bcd594e View commit details
    Browse the repository at this point in the history
  3. Dockerfile: Specify locale settings

    Avoid RuntimeError in pipenv by setting LC_ALL and LANG to C.UTF-8.
    orzen authored and nicowilliams committed Mar 29, 2019
    Configuration menu
    Copy the full SHA
    70e04d6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c4062e0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    528a4f5 View commit details
    Browse the repository at this point in the history
  6. Dockerfile: Fetch dependency as git submodule

    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.
    orzen authored and nicowilliams committed Mar 29, 2019
    Configuration menu
    Copy the full SHA
    5843701 View commit details
    Browse the repository at this point in the history
  7. Dockerfile: Uninstall oniguruma before distclean

    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.
    orzen authored and nicowilliams committed Mar 29, 2019
    Configuration menu
    Copy the full SHA
    4f58a59 View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2019

  1. jq_util_input_init: Zero memory using calloc

    Calloc will zero the allocated memory which makes one memset and a
    number of explicit zero assignments redundant.
    orzen authored and nicowilliams committed Apr 4, 2019
    Configuration menu
    Copy the full SHA
    263e106 View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2019

  1. Improve jv_is_integer()

    mfeit-internet2 authored and nicowilliams committed Apr 7, 2019
    Configuration menu
    Copy the full SHA
    ad9fc9f View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2019

  1. Configuration menu
    Copy the full SHA
    e944fe8 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2019

  1. clarify filter usage

    The current paragraph is not complete, since a digit is not a special character.
    
    Changing it to:
    
        If the key contains special characters or starts with a digit,
        you need to surround it with double quotes like this:
        `."foo$"`, or else `.["foo$"]`.
    tessus committed Jul 9, 2019
    Configuration menu
    Copy the full SHA
    8d9817d View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2019

  1. Merge pull request jqlang#1944 from tessus/doc-improvement

    clarify filter usage
    wtlangford authored Jul 14, 2019
    Configuration menu
    Copy the full SHA
    a976387 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2019

  1. docs: fix seriously dangerous download instructions for Arch Linux

    The current instructions tell users to perform two actions:
    - update the package database
    - install the jq package
    
    The only thing users need to or should be doing is actually installing
    the jq package -- regardless of which version is being installed.
    Guidelines on how to perform system updates are massively out of scope.
    
    In the case of partially performing a system update as a prerequisite
    for installing jq, the official guidance from Arch Linux is not to do
    this: partial updates are not supported, we refuse to support them, and
    anyone who does try to perform them anyway is assumed to know so much
    about their system that they clearly do not ever need help from anyone
    else (which is a good thing since they won't get it). The result is a
    frankensteined system that can only ever be supported by the person who
    frankensteined it to begin with. The only reason the package manager
    even allows it to occur in the first place is because other
    distributions using pacman might have different LTS policies, and
    because it would prevent expert users from being in control of their
    system, as per the traditional Unix philosophy:
    
    "Unix was not designed to stop you from doing stupid things, because
    that would also stop you from doing clever things."
    
    Consequences of performing partial updates without understanding the
    ramifications in extensive detail can include breaking the partially
    updated application (jq), breaking any application that shares a mutual
    dependency with the partially updated application (which jq is *lucky*
    to only depend on the ever-backwards-compatible glibc), or breaking the
    entire operating system by leaving armed traps behind for the next time
    a `pacman -S new-package` is executed and thereby breaks *its* cascading
    dependencies.
    
    See:
    https://wiki.archlinux.org/index.php/System_maintenance#Partial_upgrades_are_unsupported
    eli-schwartz committed Jul 21, 2019
    Configuration menu
    Copy the full SHA
    7877464 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2019

  1. Merge pull request jqlang#1948 from eli-schwartz/no-pacman-sy

    docs: fix seriously dangerous download instructions for Arch Linux
    wtlangford authored Jul 31, 2019
    Configuration menu
    Copy the full SHA
    37b2d21 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2019

  1. Add decNumber library

    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
    Leonid S. Usov authored and wtlangford committed Oct 22, 2019
    Configuration menu
    Copy the full SHA
    b6be13d View commit details
    Browse the repository at this point in the history
  2. Save literal value of the parsed number to preserve it for the output

    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.
    Leonid S. Usov authored and wtlangford committed Oct 22, 2019
    Configuration menu
    Copy the full SHA
    cf4b48c View commit details
    Browse the repository at this point in the history
  3. [tests] print test # from the start of the tests file to help with sk…

    …ip and take
    Leonid S. Usov authored and wtlangford committed Oct 22, 2019
    Configuration menu
    Copy the full SHA
    4860ed4 View commit details
    Browse the repository at this point in the history
  4. Add configure guards around literal jv_numbers

    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.
    wtlangford committed Oct 22, 2019
    Configuration menu
    Copy the full SHA
    74c44bc View commit details
    Browse the repository at this point in the history
  5. Remove an accidentally committed debug file

    Leonid S. Usov authored and wtlangford committed Oct 22, 2019
    Configuration menu
    Copy the full SHA
    9b51a08 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2019

  1. Configuration menu
    Copy the full SHA
    bda75c3 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2019

  1. Configuration menu
    Copy the full SHA
    e74eab8 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2019

  1. Differentiate WIN32 / Cygwin in configure script

    shlwapi.h is present on both systems
    richardWebdezign authored and nicowilliams committed Dec 30, 2019
    Configuration menu
    Copy the full SHA
    2065d6c View commit details
    Browse the repository at this point in the history
  2. Rephrase doc "A string B is contained in A" ...

    Minor rephrasing to prevent read/brain backtracking when using capital letter A as an article and a variable term.
    fwolfst authored and nicowilliams committed Dec 30, 2019
    Configuration menu
    Copy the full SHA
    707022b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    24564b2 View commit details
    Browse the repository at this point in the history
  4. Updated compile-ios.sh script.

    MCApollo authored and nicowilliams committed Dec 30, 2019
    Configuration menu
    Copy the full SHA
    4c2e63a View commit details
    Browse the repository at this point in the history
  5. compile-ios.sh: Update grammar

    MCApollo authored and nicowilliams committed Dec 30, 2019
    Configuration menu
    Copy the full SHA
    d235e97 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    839316e View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2020

  1. Configuration menu
    Copy the full SHA
    82987df View commit details
    Browse the repository at this point in the history
  2. fix typos

    Alanscut authored and nicowilliams committed Jan 2, 2020
    Configuration menu
    Copy the full SHA
    fa3733c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cf61515 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    07b18a3 View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2020

  1. outputing -> outputting

    Alanscut authored and nicowilliams committed Jan 3, 2020
    Configuration menu
    Copy the full SHA
    e7d3798 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f8ea3b3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    850e0a8 View commit details
    Browse the repository at this point in the history
  4. Support builtin modules and C-coded ext. modules

    We can now have internal modules that can be imported or included as
    "jq/<name>".
    
    And we can now have modules with shared object / DLL components defining
    C-coded jq functions.
    nicowilliams committed Jan 3, 2020
    Configuration menu
    Copy the full SHA
    9bb6bfa View commit details
    Browse the repository at this point in the history
  5. Add RNG builtins

    nicowilliams committed Jan 3, 2020
    Configuration menu
    Copy the full SHA
    bbd61b3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d4ef97e View commit details
    Browse the repository at this point in the history
  7. Add "jq/io" builtin module and -I / --io CLI opt

    We can now open and read or write from/to arbitrary files.
    
    To enable this functionality one must also use the `-I` / `--io`
    command-line option.
    nicowilliams committed Jan 3, 2020
    Configuration menu
    Copy the full SHA
    a9f05a5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    436a42b View commit details
    Browse the repository at this point in the history
  9. Co-expressions (co-routines) and eval

    The basic co-expression builtin is `coexp(expr)`, which outputs an open
    handle for the expression's VM that one can read from / write to.
    
    Two sytnactic sugar options are included:
    
     - define a co-routine:
    
        $ jq -cn 'codef ($)foo: 1,2; codef ($)bar: "a","b"; [foo,bar,foo,bar]'
        [1,"a",2,"b"]
    
       (`codef ($)name: body; ...` creates a co-routine and binds `$name` to
        its handle and `name` to a function that extracts one output from
        the co-routine)
    
     - define a function with arguments turned into co-routines:
    
        $ jq -cn 'def comingle(@@A; @@b): while(a,b); [comingle(1,2; "a","b")]'
        [1,"a",2,"b"]
    
    Also added are various utilities, and also `eval` and `coeval`.  `eval`
    evaluates its input program and outputs all its values.  `coeval`
    outputs an open handle for a VM that will evaluate its input program.
    
    A new `while/1` repeats its argument expression until it produces no
    outputs.
    nicowilliams committed Jan 3, 2020
    Configuration menu
    Copy the full SHA
    8b4f38b View commit details
    Browse the repository at this point in the history
  10. Add unwind(protect)

    nicowilliams committed Jan 3, 2020
    Configuration menu
    Copy the full SHA
    bb7f685 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e3d8945 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    ccce953 View commit details
    Browse the repository at this point in the history
  13. Make debugging slightly easier with enum name

    This allows one to print `(enum opcode)opcode` in gdb.
    nicowilliams committed Jan 3, 2020
    Configuration menu
    Copy the full SHA
    cce2728 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    b647fd3 View commit details
    Browse the repository at this point in the history
  15. Add scripts/dwarf2h

    nicowilliams committed Jan 3, 2020
    Configuration menu
    Copy the full SHA
    2fe0ff3 View commit details
    Browse the repository at this point in the history
  16. Fix try/catch catches more than it should jqlang#1859

    Rename the FORK_OPT opcode to TRY_BEGIN, add a TRY_END opcode, and wrap
    errors when raising through a TRY_END so that they will not be caught by
    the matching TRY_BEGIN.
    
    Now a `try exp catch handler` expression generates code like:
    
        TRY_BEGIN handler
        <exp>
        TRY_END
        JUMP past_handler
        handler: <handler>
        past_handler:
        ...
    
    On backtrack through TRY_BEGIN it just backtracks.
    
    If anything past the whole thing raises when <exp> produced a value,
    then the TRY_END will catch the error, wrap it in another, and
    backtrack.  The TRY_BEGIN will see a wrapped error and then it will
    unwrap and re-raise the error.
    
    If <exp> raises, then TRY_BEGIN will catch the error and jump to the
    handler, but the TRY_BEGIN will not stack_save() in that case, so on
    raise/backtrack the TRY_BEGIN will not execute again (nor will the
    TRY_END).
    nicowilliams committed Jan 3, 2020
    Configuration menu
    Copy the full SHA
    148345a View commit details
    Browse the repository at this point in the history
  17. Add try-catch-finally and fix jqlang#1608

    We can't really fix the issues with try-catch syntax, but we can
    introduce `try` as a function-like syntax, using `try(exp; handler)`
    in preference to `(try exp catch (handler))`.
    
    While we're at it, we can use the new `UNWINDING` opcode to implement
    try-catch-finally as `try(exp; handler; finally)`.
    nicowilliams committed Jan 3, 2020
    Configuration menu
    Copy the full SHA
    300f85b View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    0a09a94 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    3c09ac6 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    df08f05 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    f339f1d View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2020

  1. Configuration menu
    Copy the full SHA
    2ddd800 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2020

  1. block_inline: multi-inst inlining of functions with arguments

    * copies the inlined function's body
    * injects the instructions instead of the corresponding CALL_JQ
    * rebinds the function's parameter calls to the corresponding argument closures
    * injects the argument closures into the destination's code
    leonid-s-usov committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    c53fadf View commit details
    Browse the repository at this point in the history
  2. WIP: coroutines++: new instruction OUT, revision of TOP, RET

    This is the first commit that introduces the new instructions and the new execution loop
    START; CALL_JQ main_or_coroutine; OUT; BACKTRACK
    
    START is going to throw the handle in the parent context and initiate the read in the child context.
    More to come
    leonid-s-usov committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    d31baed View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    45603e5 View commit details
    Browse the repository at this point in the history
  4. oops

    leonid-s-usov committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    9675459 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ad89e99 View commit details
    Browse the repository at this point in the history
  6. block_inline: properly update imm.target of the copied instruction

    in case we copy a block of instructions and some of them are branching to the others
    within the same block, then the copied instructions would still carry
    invalid target references.
    To fix it we introduce a copy state so that it's easy to remap the
    affected instructions.
    leonid-s-usov committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    65e3ea2 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2020

  1. Configuration menu
    Copy the full SHA
    32de6a0 View commit details
    Browse the repository at this point in the history
  2. VM: improve debug trace

    leonid-s-usov committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    4f867be View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d449484 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2020

  1. coexp: ITS ALIVE!

    leonid-s-usov committed Jan 27, 2020
    Configuration menu
    Copy the full SHA
    f1f29bd View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2020

  1. Add back the lost output builtin

    Leonid Usov committed Jan 28, 2020
    Configuration menu
    Copy the full SHA
    5379ef2 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2020

  1. Configuration menu
    Copy the full SHA
    b1d67fd View commit details
    Browse the repository at this point in the history
  2. compile: account for all backtracking instructions

    when considering to add RET_JQ at the end of a block.
    currently two instructions backtrack: BACKTRACK and TAIL_OUT
    leonid-s-usov committed Jan 29, 2020
    Configuration menu
    Copy the full SHA
    48b3a75 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ad5405f View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2020

  1. fix I/O policy leak

    nicowilliams committed Jan 31, 2020
    Configuration menu
    Copy the full SHA
    9fdf955 View commit details
    Browse the repository at this point in the history
  2. Fix jqlang#2051 -- iterate arrays backwards in path ctx

    In case a path gets deleted, we should iterate arrays backwards in
    path/1 context.
    nicowilliams committed Jan 31, 2020
    Configuration menu
    Copy the full SHA
    9c9013b View commit details
    Browse the repository at this point in the history
  3. No more EOF error

    nicowilliams committed Jan 31, 2020
    Configuration menu
    Copy the full SHA
    fd5dc00 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2020

  1. codef/1: set the coexp context to jv_null()

    Leonid Usov committed Feb 1, 2020
    Configuration menu
    Copy the full SHA
    15d72dd View commit details
    Browse the repository at this point in the history
  2. compile: yet less preliminary optimizations

    Now the RET_JQ will only be omitted for the top level program.
    It will look uglier being present after BACKTRACKs or TAIL_OUTs,
    but it's at least safe
    Leonid Usov committed Feb 1, 2020
    Configuration menu
    Copy the full SHA
    c299d39 View commit details
    Browse the repository at this point in the history
  3. block_inline: fix the case when a block of a single CALL_JQ gets inli…

    …ned; fix a potential memory leak
    
    For the case of a block_is_single(block) input, the function interface is updated to return an updated block
    Additionally, a new inst_dispose method is called on the CALL_JQ instruction to make sure
    that the resources which are overwritten are properly released.
    Leonid Usov committed Feb 1, 2020
    Configuration menu
    Copy the full SHA
    f05c44d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    89c1a13 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b516ad3 View commit details
    Browse the repository at this point in the history
  6. VM: jq_input_mode

    typedef enum jq_input_mode_enum {
      // JQ VM reaches a state where it requires the next input
      // when it backtracks to START.
      // At this point the VM can behave differently, and this enum
      // describes the possible actions VM will take.
    
      // In the RETURN_EMPTY mode jq_next behaves like it always did:
      // it will return a jv_invalid() without any message
      // to show that additional input is needed
      // The caller in this case may choose to restart the VM
      // or set the next value and call jq_next again
      JQ_INPUT_RETURN_EMPTY,
    
      // In the CALLBACK mode jq_next will issue an input callback
      // in case it will require more input. This will be equivalent
      // to when the jq program reaches the `input` instruction.
      // passing an invalid to the callback will immediately request input again
      // passing an invalid with message will raise this as an error and halt
      JQ_INPUT_CALLBACK,
    
      // A backward compatible default mode
      JQ_INPUT_DEFAULT = JQ_INPUT_RETURN_EMPTY
    } jq_input_mode;
    Leonid Usov committed Feb 1, 2020
    Configuration menu
    Copy the full SHA
    e20de9b View commit details
    Browse the repository at this point in the history
  7. Revert "Fix jqlang#2051 -- iterate arrays backwards in path ctx"

    This reverts commit 9c9013b.
    Leonid Usov committed Feb 1, 2020
    Configuration menu
    Copy the full SHA
    e1da52b View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2020

  1. block_inline: improve performance of the inlining

    Leonid Usov committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    d04ff52 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2020

  1. Configuration menu
    Copy the full SHA
    dfe2d80 View commit details
    Browse the repository at this point in the history
  2. Backtrack signalling

    leonid-s-usov committed Feb 9, 2020
    Configuration menu
    Copy the full SHA
    3202411 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0164f63 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2020

  1. Configuration menu
    Copy the full SHA
    f88fff7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cdf2ba6 View commit details
    Browse the repository at this point in the history