Repository navigation
Make ? give no output on a type mismatch and stop hiding undefined functions - #83
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
davesnx
marked this pull request as ready for review
November 9, 2026 23:50
davesnx
added a commit
that referenced
this pull request
Nov 10, 2026
* origin/main: Speed up interpreter hot paths and JSON rendering (#72) Fit the playground to the viewport and move the share button next to the query (#81) Make ? give no output on a type mismatch and stop hiding undefined functions (#83) Move .cursor documents to docs and stop tracking .cursor (#84) # Conflicts: # README.md # cli/cli.ml # source/Core.ml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #62.
?turned every runtime error intonull, so a path through irregular data printednullvalues for elements of the wrong type. It now givesnullonly for an absent value.?andtrywithoutcatchgive no output on a type mismatch, as jq does:"x" | .a?,1 | .[]?,null | .[]?,123 | keys?.null: a missing key, a key or an index onnull, an index out of bounds,first?on[].?andtrywithoutcatchno longer hide an undefined function:foo?reports the error.try foo catch .kindstill gives"undefined_function".nullor a number is an error; it used to stop with an OCamlAssertion failed.Runtime_error.when_caughtis the one place that maps an error kind tonull, no output, or propagation. Its match lists every kind.main(2c08a49).users[].metadata?.preferences?[]?.notifications?.email?null,null,"bob@example.com""bob@example.com""bob@example.com"Plain access stays strict, and a
?is still needed on each step that can be absent. The proposals in #62 to skip missing values by default, and to add!, are not taken.Checked at 822534e with
dune test --force --root .: 824 runtime and parser tests and 103 reader tests pass. Each commit's new tests were run against its parent first and failed there.Risk: two-way door for the code; a revert restores the old
?. It is a breaking language change for users: a query that relied on?givingnullfor a value of the wrong type, or onfoo?hiding an undefined function, gives different output.CHANGES.mdanddocs/JQ_COMPATIBILITY.mddescribe it.