✨ feat(mq-lang): add jq-parity builtins for type filters, entries conversion, and regex#1932
Merged
Conversation
…version, and regex Closes the gap with jq's `strings`/`objects`/`nulls`/`iterables`/`scalars` type filters, `from_entries`/`with_entries`/`has` object conversion helpers, and `scan`/sub-style regex matching (exposed as `gsub_first` since `sub` is already mq's arithmetic subtraction builtin).
Merging this PR will degrade performance by 22.17%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | eval_macro_expansion_simple |
101 µs | 129.7 µs | -22.17% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/jq-parity-builtins (ec68673) with main (be82f9f)1
Footnotes
Add `to_boolean`, matching jq's `toboolean`: booleans pass through unchanged, the strings "true"/"false" convert to their boolean equivalent, and all other input raises a type error.
…o_boolean Registers missing type signatures for the recently added jq-parity builtins (scan, to_boolean) and the previously unregistered is_not_regex_match, plus table-driven tests covering the dict (has/from_entries/with_entries) and type-filter (strings/dicts/nones/ bytes/iterables/scalars) builtins defined in builtin.mq.
…arkdown builtins Registers missing type signatures for previously unchecked native builtins (ln, log10, sqrt, exp, gmtime, localtime, mktime, strftime, date_add, date_diff, basename, dirname, extname, stem, path_join, file_exists, read_file_bytes, collection, to_blockquote, to_delete, to_callout, to_md_fragment, to_md_table_align, is_callout, is_table_align), plus table-driven tests covering each.
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.
Closes the gap with jq's
strings/objects/nulls/iterables/scalarstype filters,from_entries/with_entries/hasobject conversion helpers, andscan/sub-style regex matching (exposed asgsub_firstsincesubis already mq's arithmetic subtraction builtin).