Skip to content

✨ feat(mq-lang): add jq-parity builtins for type filters, entries conversion, and regex#1932

Merged
harehare merged 4 commits into
mainfrom
feat/jq-parity-builtins
Jun 25, 2026
Merged

✨ feat(mq-lang): add jq-parity builtins for type filters, entries conversion, and regex#1932
harehare merged 4 commits into
mainfrom
feat/jq-parity-builtins

Conversation

@harehare

Copy link
Copy Markdown
Owner

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).

…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).
@codspeed-hq

codspeed-hq Bot commented Jun 25, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 22.17%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 30 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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

Open in CodSpeed

Footnotes

  1. No successful run was found on main (c5fdb51) during the generation of this report, so be82f9f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

harehare added 3 commits June 25, 2026 21:37
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.
@harehare harehare merged commit 43ef138 into main Jun 25, 2026
10 of 11 checks passed
@harehare harehare deleted the feat/jq-parity-builtins branch June 25, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant